Dither Area
betaAn area chart filled with dithered cells over a cell grid, with a date scrubber that swells the cells around it.
- Data
- 1 file
- 1 npm package
- Accessibility notes
- Draws on a canvas
Loading the example…
pnpm dlx @dowel-ui/cli add dither-areanpm packages installed: class-variance-authority.
import { AREA } from "@/components/ui/dither-area";Default
Dither Area Growth
Gallery
Controlled
Info Colour
With Visible Table
Static
<DitherArea>
| Prop | Type | Default |
|---|---|---|
data (required) | readonly DitherAreaDatum[] | — |
label (required)What the chart shows. Names the image, the scrubber and the data table. | string | — |
animate | boolean | true |
categoryLabelData table headers. | string | "Point" |
cell | number | — |
colorColour token or CSS colour expression for the fill. Default "primary". | string | "primary" |
defaultIndex | number | null | — |
descriptionReplaces the generated summary in the image's accessible name. | string | — |
formatValue | (value: number) => string | formatDitherValue |
indexCursor point (controlled); null hides it. | number | null | — |
maxAxis maximum. Defaults to the largest value. | number | — |
onIndexChange | (index: number | null) => void | — |
showAxisShow value ticks and point labels. | boolean | true |
showTableShow the data table. It is always present for assistive technology. | boolean | false |
size | "sm" | "md" | "lg" | "md" |
valueLabel | string | "Value" |
Plus every attribute of <div> except children.
The plot is role="img" with an aria-label giving the range, start, end and peak. The scrubber over it is a slider: arrow keys step a point, Page keys jump a tenth, Home/End go to the ends, Escape hides the cursor, and aria-valuetext announces the date and value shown in the readout. Axis ticks are aria-hidden; the data is always in a table, visually hidden unless showTable is set.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes