Examples gallery
Choose a focused example to try it and see the configuration. Some resources are hosted externally and require network access and CORS.
Configuration playground
Combine options and try them in the viewer below. Colours, ruler and measurement update without reloading; other changes restart the viewer and reset its current view.
The physical ruler option enables the floating zebra scale, reference objects and calibration controls together. Open Ruler, then Compare size; the scale needs physical metadata or manual calibration. Try the pre-calibrated scale example. Ruler, measurement and download require a 2D image; comparison is most useful with multiple canvases. Changing ruler or measurement resets calibration and measurements.
Kiosk configuration
The viewer opens in a page-filling kiosk view. With the viewer focused, press Ctrl+Alt+K to switch to maintenance mode and back; after two minutes of inactivity it resets to the starting image. Browser or operating system kiosk controls are required to prevent leaving the page or exiting fullscreen.
new IIIFViewer('#example-kiosk', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/rosetta-stone-manifest.json',
showSidebar: false,
kiosk: { shortcut: 'Ctrl+Alt+K', inactivityMs: 120000 },
});
Georeferenced London aerial imagery
Open Map and enable Show raster overlay to compare real aerial imagery of central London with the basemap. Expand the map and adjust Overlay opacity to compare the layers. The example IIIF manifest includes the image and its geographic footprint; the four image corners are supplied separately below. Imagery and basemap require network access.
Source: Esri, Vantor, Earthstar Geographics, and the GIS User Community. The 2048 × 1536 image is an Esri World Imagery export in EPSG:3857 with extent [-20000, 6707000, -6000, 6717500] metres. The corners below are that extent transformed to longitude and latitude; imagery may change as the service is updated.
const imageUrl = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export?bbox=-20000,6707000,-6000,6717500&bboxSR=3857&imageSR=3857&size=2048,1536&format=jpg&f=image';
new IIIFViewer('#example-georeferenced-london', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/georeferenced-london-manifest.json',
showSidebar: true,
mapRaster: {
canvasId: 'https://micropasts.github.io/iiif-viewer/examples/georeferenced-london/canvas',
url: imageUrl,
coordinates: [
[-0.17966305682390432, 51.54069775057982],
[-0.053898917047171285, 51.54069775057982],
[-0.053898917047171285, 51.481994867307726],
[-0.17966305682390432, 51.481994867307726],
],
opacity: 0.7,
attribution: 'Source: Esri, Vantor, Earthstar Geographics, and the GIS User Community',
},
});
Raster overlay and fullscreen map
Open Map, then select Show raster overlay or Fullscreen map. This synthetic image and its coordinates are illustrative, not a historical georeference.
new IIIFViewer('#example-map-raster', {
manifest: {
type: 'Manifest', id: 'https://example.org/raster-manifest',
label: { en: ['Illustrative raster'] },
items: [{
type: 'Canvas', id: 'https://example.org/canvas/raster', width: 600, height: 400,
items: [{ items: [{ motivation: 'painting', body: {
type: 'Image', id: 'https://micropasts.github.io/iiif-viewer//examples/images/overlay-example.png'
} }] }],
}],
},
showSidebar: true,
mapRaster: {
canvasId: 'https://example.org/canvas/raster',
url: 'https://micropasts.github.io/iiif-viewer/examples/images/overlay-example.png',
coordinates: [[-0.2, 51.55], [-0.05, 51.55], [-0.05, 51.48], [-0.2, 51.48]],
opacity: 0.7,
},
});
IIIF Georeference Annotation and warped map
This standalone Georeference Annotation URL is converted into a normal IIIF image canvas, then its GCPs, SVG mask and transformation are used to warp the IIIF ImageService onto a map. Use Image and Map in the viewer toolbar, then change the basemap or overlay opacity from the map controls. The source annotation, IIIF tiles and basemaps require network access.
new IIIFViewer('#example-georeference-annotation', {
manifestUrl: 'https://annotations.allmaps.org/images/4af0fa9c8207b36c',
showUrlInput: false,
showSidebar: true,
baseMaps: [
{ label: 'Liberty', style: 'https://tiles.openfreemap.org/styles/liberty' },
{ label: 'Positron', style: 'https://tiles.openfreemap.org/styles/positron' },
],
});
The annotation itself is the input resource; it contains the target ImageService, control points and resource mask. Invalid annotations remain usable in the standard Image view and display a non-blocking warning.
Geographic annotation on a map
Open the Map tab and select the location to focus the annotated image fragment. The map shows the geographic feature, not a georeferenced image overlay. The IIIF Cookbook manifest, image and basemap require network access.
new IIIFViewer('#example-geographic-annotation', {
manifestUrl: 'https://iiif.io/api/cookbook/recipe/0139-geolocate-canvas-fragment/manifest.json',
showSidebar: true,
});
Browse a collection
Select Sample volumes, then choose a manifest. Use the breadcrumbs to go back and the Collections button to reopen the browser. The Caryatid image is served by the British Museum; audio and video samples require an internet connection.
new IIIFViewer('#example-collection', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/collection.json',
proxyRoutes: {
'https://micropasts.github.io/iiif-viewer/examples/': 'https://micropasts.github.io/iiif-viewer/examples/',
},
showUrlInput: false,
showSidebar: false,
});
Browse a navDate timeline
Explore the IIIF Cookbook's dated map collection in chronological order. Select a timeline entry to open its manifest. This example requires network access and CORS support from the resource providers.
new IIIFViewer('#example-timeline', {
manifestUrl: 'https://iiif.io/api/cookbook/recipe/0230-navdate/navdate-collection.json',
timeline: true,
showSidebar: false,
});
Wellcome collection timeline scrubber
The first issue opens automatically. Select Timeline and move the slider to open another dated issue. The collection, manifests and images require network access and CORS support.
new IIIFViewer('#example-wellcome-timeline', {
manifestUrl: 'https://iiif.wellcomecollection.org/presentation/b19974760_1',
timeline: 'scrubber',
showSidebar: false,
});
Canvas timeline scrubber
Open the Timeline overlay and use the slider or arrow keys to navigate dated canvases. This example repeats a British Museum image with illustrative dates; the image requires network access.
new IIIFViewer('#example-timeline-scrubber', {
manifest: datedManifest,
timeline: 'scrubber',
showSidebar: false,
showUrlInput: true,
});
Play audio and video
Use the filmstrip to switch between a short video and an audio clip. Open Info, then select an Index entry or a time in Notes to seek without starting playback. Use the player controls to play, seek or make the video fullscreen, and Playback options for volume, speed and video captions.
Media samples are from MDN's public-domain examples and require an internet connection. Playback and caption rendering depend on your browser.
new IIIFViewer('#example-media', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/media-manifest.json',
showUrlInput: false,
showSidebar: true,
});
Customise viewer colours
Choose an accent to update this viewer without changing the rest of the page. Default restores the viewer's theme colours. Try the page theme toggle too; custom colours stay in place in both themes. Check that your chosen colours have sufficient contrast.
const viewer = new IIIFViewer('#example-colours', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
themeVars: { '--iiif-accent': '#b45309', '--iiif-accent-hover': '#92400e' },
});
viewer.setThemeVars({ '--iiif-accent': '#0f766e', '--iiif-accent-hover': '#115e59' });
// Use null to remove an inline override and restore the CSS default.
Hide the URL bar
The URL input and Load button are hidden, but dropping a manifest link still works.
new IIIFViewer('#example-no-url', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
showUrlInput: false,
});
Configure image filters
Choose which image filters appear in the toolbar, or turn filtering off completely. Changes remount the viewer so the generated configuration matches the controls shown.
Disable manifest drops
The URL bar remains available, but dropping a manifest link does not load it.
new IIIFViewer('#example-no-drop', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
allowManifestDrop: false,
});
Start with fewer controls
The URL bar and manifest drops are disabled, and the sidebar starts closed. The Info button can still open it.
new IIIFViewer('#example-minimal', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
showUrlInput: false,
allowManifestDrop: false,
showSidebar: false,
});
Resize the information panel
On desktop, drag the divider at the left of the Info panel to change its width. You can also use its keyboard controls or open Panel width at the bottom for narrower, wider and reset buttons. On narrow screens the panel remains an overlay.
new IIIFViewer('#example-resizable-sidebar', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
showSidebar: true,
resizableSidebar: true,
});
Choose information tabs
Show only the information sections your audience needs. This example keeps Metadata and Search; the other tabs are omitted.
new IIIFViewer('#example-sidebar-tabs', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
showSidebar: true,
sidebarTabs: ['metadata', 'search'],
});
Hide external viewer links
The Metadata tab remains available without links to external IIIF tools.
new IIIFViewer('#example-no-external-viewers', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
externalViewers: false,
});
Compare canvases side by side
Select Compare to view two pages of this book. Open Comparison settings to choose another canvas, load a different manifest, or swap panes. Sync View remains available while you compare.
new IIIFViewer('#example-side-by-side', {
manifestUrl: 'https://iiif.library.ucla.edu/ark%3A%2F21198%2Fn16c9s/manifest',
showSidebar: false,
sideBySide: true,
});
Canvas orientation & Rotation
Rotate the image or use the flip buttons in Filters, then choose another canvas. Orientation follows you within the manifest and resets when a new manifest is loaded.
new IIIFViewer('#example-orientation', {
manifestUrl: 'https://iiif.library.ucla.edu/ark%3A%2F21198%2Fn16c9s/manifest',
showUrlInput: false,
showSidebar: false,
persistCanvasTransform: true,
});
Inspect IIIF JSON
Open Inspector to explore the loaded manifest or current canvas as a collapsible tree or syntax-highlighted JSON. Copy or download the selected resource; navigate between canvases to update the canvas view.
new IIIFViewer('#example-inspector', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
showUrlInput: false,
showSidebar: false,
inspector: true,
});
Zebra scale and reference objects
Try the zebra scale and familiar objects on a pre-calibrated illustration. Select Ruler in the viewer, then Hide settings. In the floating scale panel, select Compare size and choose an object; zoom to compare. The illustration uses a fictional scale of 1 mm per pixel; real images require reliable physical metadata or manual calibration.
const manifest = {
type: 'Manifest', id: 'https://example.org/scale-demo',
label: { en: ['Illustrative scaled image'] },
items: [{
type: 'Canvas', id: 'https://example.org/scale-demo/canvas',
width: 600, height: 400,
physicalDimensions: {
profile: 'http://iiif.io/api/annex/extensions/physdim',
physicalScale: 1, physicalUnits: 'mm',
},
items: [{ items: [{
motivation: 'painting', target: 'https://example.org/scale-demo/canvas',
body: { type: 'Image', id: 'https://micropasts.github.io/iiif-viewer/examples/images/scale-demo.svg' },
}] }],
}],
};
new IIIFViewer('#example-scale', {
manifest, showUrlInput: false, allowManifestDrop: false,
showSidebar: false, physicalRuler: true,
});
Rosetta Stone scale comparison
Compare the Rosetta Stone with familiar objects using the zebra scale. Open Ruler, enter 0.36 millimetres per image pixel and select Apply scale. Then select Hide settings and Compare size to choose an object.
This approximate scale uses the museum's stated maximum height of 1123 mm and the stone's height in this image. Perspective, depth and the irregular outline limit its accuracy; it is not suitable for precise measurement. Alternatively, draw a vertical calibration line spanning the stone's full height and enter 1123 mm. The image requires network access.
new IIIFViewer('#example-rosetta-scale', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/rosetta-stone-manifest.json',
showUrlInput: false, allowManifestDrop: false,
showSidebar: false, physicalRuler: true,
});
Measure an image
Open Measure, choose point-to-point, polyline or area, then select Start and click points on the image. Select Finish for a polyline or area; Escape cancels a drawing. Results are in image pixels unless a physical scale is available. Open Ruler to calibrate a known distance and compare a zebra scale bar and familiar objects. A photograph of a three-dimensional object does not generally have a uniform physical scale.
new IIIFViewer('#example-measurement', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
showUrlInput: false,
allowManifestDrop: false,
showSidebar: false,
physicalRuler: true,
measurement: true,
});
Download an image
Enable a size-selectable full-image download. The image provider's rights and size restrictions still apply. The British Museum's policies are restrictive...
new IIIFViewer('#example-download', {
manifestUrl: 'https://micropasts.github.io/iiif-viewer/examples/caryatid-manifest.json',
showUrlInput: false,
allowManifestDrop: false,
physicalRuler: true,
imageDownload: { widths: [300, 600], maxPixels: 4000000 },
showSidebar: false,
});