Forms
Color Picker
A grid of swatches for choosing a color. Click a swatch to pick it, and add the browser’s native color input when you need it.
ReactVueWeb Components
View in Storybook Playground
Examples
<ColorPicker aria-label="テーマ色" defaultValue="#cd2e69" onChange={setColor} /> Props
| Name | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled value (hex). |
defaultValue | string | — | Initial value when uncontrolled. @default DEFAULT_SWATCHES[0] |
onChange | (hex: string) => void | — | Called with the chosen hex color. |
swatches | string[] | — | Preset swatches. @default DEFAULT_SWATCHES |
custom | boolean | true | Allow a custom color via the native picker. @default true |
customLabel | string | Custom | Label for the custom-color control. @default 'Custom' |
aria-label | string | Color | Accessible label for the swatch group. @default 'Color' |
className | string | — |
Accessibility
- Body/background contrast is ≥ 7:1 (AAA) in both light and dark.
- Every interaction works with the keyboard alone.
- The focus ring is always visible.
- Respects prefers-reduced-motion and stops excessive motion.
Every component is designed to meet WCAG 2.1 AAA.