ColorButton is a small secondary button that shows a swatch and the colour's hex, and opens the browser's colour picker. Before a colour is picked it shows its label beside a swatch of every hue. Use it for a custom colour beside a row of preset swatches, where a full ColorInput field would be too heavy.
- onValueChange fires on every drag while the picker is open. Use it for a live preview.
- onValueCommit fires once, when the picker closes on a new colour. Save, send or record an undo step here, so a drag does not produce dozens of saves.
The button shows the dragged colour while the picker is open, even before the host commits it.
The button is the control. Its accessible name is the label followed by the colour (Own colour: #00B5BA). The native colour field it opens is out of the Tab order and hidden from assistive technology. To link a note under the button, such as a contrast warning, pass its id as aria-describedby.