Browse components
Swatch Picker
Color swatches where the selection ring glides from one to the next and a check pops in on the chosen color, picking a dark or light check to suit it. Arrow keys move the choice.
Installation
npx shadcn@latest add @glint-ui/swatch-pickerFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/swatch-picker.json
Usage
import { SwatchPicker } from "@/components/ui/swatch-picker";
<SwatchPicker
colors={[{ name: "Lime", value: "#b5e61d" }, { name: "Sky", value: "#38bdf8" }]}
value={color}
onChange={setColor}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | "Color" | Group label. |
| size | number | 32 | Swatch diameter in px. |
| colors | ReactNode | — | Array of { name, value } with hex values. |
| value | ReactNode | — | Controlled selection, pair with onChange. |
| className | string | — | Extra classes for the root element. |