Label
<Clover.Label /><clover-label>0.5 kB added to a page with a Root, gzipped1 kB added to a page with a <clover-root>, styles included, gzipped
The resource’s label, or the current Canvas’s, in the reader’s language.
<Clover.Root iiifContent={url}>
<Clover.Label as= of= />
</Clover.Root><clover-root
iiif-content="https://clover.iiif.library.northwestern.edu/mocks/paged/manifest.json">
<clover-label as= of=></clover-label>
</clover-root>API reference
Reads label from the Root’s resource, as plain text, and renders a span. It renders
nothing while there is no label. Its other props, and its ref, go to its element.
<clover-label>
A label, as Label draws it, marked with the language it is in. Inside a clover-root, the Manifest's or the Canvas's; alone, the one it is given. Nothing is drawn while there is none, so a heading is never left empty.
Examples
As a heading
Use as to make it a heading, at the level that fits your page’s outline: here, under an
h3, an h4.
<Clover.Label as="h4" /><clover-label as="h4"></clover-label>The current Canvas
Use of="canvas" for the label of the Canvas in view. It changes as the reader moves.
<Clover.Body />
<Clover.Label of="canvas" as="p" /><clover-body></clover-body> <clover-label of="canvas" as="p"></clover-label>In its own language
A label is read in the Root’s language, else the page’s, and carries the language it is
in as lang, so it is read aloud in that language. This newspaper’s label is German.
<Clover.Root iiifContent="https://clover.iiif.library.northwestern.edu/mocks/content-search/manifest.json">
<Clover.Label as="p" />
</Clover.Root><clover-root
iiif-content="https://clover.iiif.library.northwestern.edu/mocks/content-search/manifest.json">
<clover-label as="p"></clover-label>
</clover-root>Previous versions
- Inside a
Root<clover-root>, leave outlabel: it reads the resource’s own. - 3.x’s
langis the Root’slanguage.