SwatchGroup
Row of selectable circular color/image swatches with single-select behaviour,
built on Base UI RadioGroup. Selection is controlled via value +
onValueChange, or uncontrolled via defaultValue. When icon is set the
selected swatch shows that icon instead of the default selection ring.
Usage
Best practices
Drive selection with
value+onValueChange(ordefaultValue), not per-swatchonClick- it's a Base UIRadioGroup, so it already handles roving focus and arrow-key selection.Choose
SwatchGroupwhen you want radio semantics + keyboard a11y; reach forSwatchSelectoronly for a lighter controlled row without the RadioGroup roles.Set
icon(e.g.Check) on the group to swap the selection ring for a glyph on the chosen swatch, rather than styling items individually.
Props
SwatchGroup
SwatchGroupItem
Composition
Builds on