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.
Open Info to see tabs and external links. Ruler, measurement and download require a 2D image; comparison is most useful with multiple canvases. Changing ruler or measurement resets calibration and measurements.
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: './examples/collection.json',
proxyRoutes: {
'https://micropasts.github.io/iiif-viewer/examples/': new URL('./examples/', window.location.href).href,
},
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: './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: './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: './examples/caryatid-manifest.json',
showUrlInput: false,
});
Disable manifest drops
The URL bar remains available, but dropping a manifest link does not load it.
new IIIFViewer('#example-no-drop', {
manifestUrl: './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: './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: './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: './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: './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: './examples/caryatid-manifest.json',
showUrlInput: false,
showSidebar: false,
inspector: 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, but note that a photograph of a three-dimensional object does not generally have a uniform physical scale.
new IIIFViewer('#example-measurement', {
manifestUrl: './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: './examples/caryatid-manifest.json',
showUrlInput: false,
allowManifestDrop: false,
physicalRuler: true,
imageDownload: { widths: [300, 600], maxPixels: 4000000 },
showSidebar: false,
});