Dot Variants
Each colour is a swatch of cloth printed in its own three inks, lit from the top left with a sheen; sizes are plain buttons. Choose one and a ring of dots is drawn round it. Sold-out options are struck through and skipped, a size that's nearly gone says how many are left, and hovering a swatch names it. Native radio buttons underneath, so arrows, Tab and forms all work.
Needs: None. A tiny canvas per swatch.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| groups | { name; options: { value; label; color?; soldOut?; left? }[] }[] | required | One group per choice: colours (options with a color) or sizes. |
| value | Record<string, string> | – | Chosen option per group name. Leave unset to let it keep its own. |
| defaultValue | Record<string, string> | – | Chosen at first; the first in stock of each group by default. |
| onChange | (value) => void | – | Called with every group's choice when one changes. |
| lowStock | number | 5 | Say "Only N left" at or under this many. |
| className | string | – | Class on the pickers. |
| style | CSSProperties | – | Style on the pickers. |