Editorial · @csdr/editorial
Figure
Numbered figure with caption, source, a11y wiring and wide/full breakouts. Wrap charts, images and maps in it.
- Import
import { Figure } from '@csdr/editorial'- Use on
- reports · landing · docs
When to use
Any chart, map or image that a reader might refer to. In MDX, give it an id and it is numbered automatically; <Ref to="…"/> resolves to “Figure N”. Charts inside a Figure inherit its caption for accessibility (aria-labelledby).
Chart in a numbered figure
View data
| habitat | extent (thousand ha) |
|---|---|
| Mangroves | 36 |
| Seagrass | 20 |
| Saltmarsh | 5 |
Code
<Figure id="fig-extent" caption="Extent of coastal blue-carbon habitats (illustrative)." source="Illustrative values." width="wide">
<BarChart data={rows} x="habitat" y="extent" unit="thousand ha" alt="Bar chart: mangroves 36, seagrass 20, saltmarsh 5 thousand hectares." />
</Figure>Outside MDX (as here) pass `number` yourself or leave it off.
Image with caption (Markdown shorthand)
image
Code
In reports, Markdown images with a title auto-upgrade to a captioned figure via the components map.
Props
id,caption,source,numberwidth:content(default) ·wide·fullplate(default true): light plate behind the content; keep for chartskind:figure·map·image