Document
<Viewer template={Document} /><clover-viewer template="document">95 kB loaded by a page with the Viewer in Document to first view, styles included, gzipped133 kB loaded by a page with a <clover-viewer> in Document to first view, styles included, gzipped
Reads as a PDF does: a toolbar, page thumbnails down the left, the pages down one column, and the information panel on the right.
import Viewer from "@nulib/clover";
import { Document } from "@nulib/clover/templates";
import "@nulib/clover/styles.css";
import "@nulib/clover/templates.css";
<Viewer
iiifContent="https://clover.iiif.library.northwestern.edu/mocks/paged/manifest.json"
template={}
defaultSidebarOpen={}
defaultPanelOpen={}
panelLayout=
/>;<script type="module">
import "@nulib/clover/web-components";
</script>
<clover-viewer
iiif-content="https://clover.iiif.library.northwestern.edu/mocks/paged/manifest.json"
template=
sidebar-open=""
panel-open=""
panel-layout=>
</clover-viewer>API reference
The toolbar holds the title, Download’s links where there is a rendering, and the
provider’s logo. The pages run down one column, a spread to a sheet, the top of the next
always showing: scrolling moves through them as a PDF reader’s continuous view does, and
PageUp and PageDown go a sheet at a time. A resource of one page has no thumbnails unless
singleItemsingle-item asks for them.
The thumbnails’ toggle sits on the bar between them and the pages; drag the bar, or use
the arrow keys on it, to widen or narrow them. The information panel sits to the right of
the pages, with its own bar, where there is room for both, and slides out over them where
there is not. On a phone the thumbnails float over the page too, and choosing one puts
them away. Size it with --clover-template-document-height.
<clover-viewer>
Clover's Viewer, in one of its templates: Default (the title over the Body, the thumbnails under it, the information panel beside them), Document (a PDF reader's pages, thumbnails beside them) or Gallery (a grid, each item opening in a lightbox). Each template loads when used, its styles with it.
Examples
Thumbnails put away
Use defaultSidebarOpen={false}sidebar-open="false" to start with the page thumbnails put away, their toggle
over the page’s top left.
<Viewer iiifContent={url} template={Document} defaultSidebarOpen={false} /><clover-viewer
iiif-content="https://clover.iiif.library.northwestern.edu/mocks/paged/manifest.json"
template="document"
sidebar-open="false"></clover-viewer>Panel open
Use defaultPanelOpenpanel-open to start with the information panel open beside the pages. On a
phone, where it would cover them, it starts closed whatever you pass.
<Viewer iiifContent={url} template={Document} defaultPanelOpen /><clover-viewer
iiif-content="https://clover.iiif.library.northwestern.edu/mocks/paged/manifest.json"
template="document"
panel-open></clover-viewer>One page
Use singleItemsingle-item to show the page thumbnails, and their toggle, even where the resource
has one page.
<Viewer iiifContent={url} template={Document} singleItem /><clover-viewer
iiif-content="https://clover.iiif.library.northwestern.edu/mocks/navplace/manifest.json"
template="document"
single-item></clover-viewer>