Sizes
Brand
Click any swatch to copy its hex code to the clipboard.
npx shadcn@latest add https://sdk-components.thesqd.com/r/color-swatch.json https://sdk-components.thesqd.com/r/color-picker.jsonimport { ColorSwatch } from "@/components/ui/color-swatch";
import { ColorPicker } from "@/components/ui/color-picker";import * as React from "react";
import { ColorPicker } from "@/components/ui/color-picker";
export function Example() {
const [color, setColor] = React.useState("#F5B81E");
// Pass label/caption/error for the uniform field shell shared with
// DurationInput / FileSizeInput.
return <ColorPicker value={color} onChange={setColor} />;
}ColorSwatch (button)
└── visual chip — copies hex on click by default
ColorPicker (inline display/edit field — same h-9 rounded-md cards as DurationInput / FileSizeInput)
├── Swatch card — click to grow the flower wheel out of its centre
├── Hex card — display mode: #HEX + ✏️ → edit mode: hex input card + ✓ commit card
└── Popover panel (portaled to <body>, scales up from the swatch centre)
├── Mode tabs (sm) — "Color Wheel" / "Classic Picker" (showModeSwitch={false} hides them)
├── Wheel mode — flower wheel
│ ├── Tinted plate + petal rings (12 saturated + 8 softer hues)
│ ├── Center petal — live color preview, click to confirm + close
│ └── Curved lightness arc (white → hue → black) with draggable thumb
├── Picker mode — ColorPickerPanel
│ ├── Saturation / brightness square
│ ├── Hue + alpha gradient tracks
│ └── Format select (HEX/RGB/HSL/OKLCH) + value field + eyedropper
└── Footer — hex readout bottom left · selection progress bottom right
ColorPicker multiple (selection summary + wheel)
├── Swatch card — live color, opens the wheel
├── Summary card — stacked chips + "Select X more" / "n of max"
└── Wheel panel
├── Center petal — + adds the live color (✓ when already picked, locked at max)
├── Selected swatch row — click a chip to remove it
└── Progress line — "Select X more" → "n of max" + DoneSizes
Brand
Click any swatch to copy its hex code to the clipboard.
| Swatch | Hex Code | Category |
|---|---|---|
| #341756 | Primary | |
| #F9635D | Primary | |
| #513DE5 | Primary | |
| #A960FF | Primary | |
| #F2AF39 | Primary | |
| #CC4291 | Primary | |
| #BCB3F9 | Secondary | |
| #DEC1FF | Secondary | |
| #EB8EC3 | Secondary | |
| #FFDB9B | Secondary | |
| #FFA8A4 | Secondary | |
| #FFB48B | Secondary |
Click the swatch to open the flower wheel — petals set hue and saturation, the curved arc sets lightness. Click the hex pill to type a value, then ✓ to commit.
The wheel’s centre petal adds the live color to the selection; the panel counts down “Select X more” until `minColors` is met, then offers Done. Click a selected swatch to remove it.
Opens straight onto the classic panel — saturation square, hue and alpha tracks, a HEX/RGB/HSL/OKLCH format select and (in Chromium) an eyedropper. The Color Wheel / Classic Picker tabs flip between surfaces; pass `showModeSwitch=` to lock the popover to one.
ColorSwatch
| Prop | Type | Default | Description |
|---|---|---|---|
color | string | — | Any CSS color value (hex, rgb, hsl, or a named color). |
size | "sm" | "default" | "lg" | "default" | Visual footprint of the chip. |
copyOnClick | boolean | true | Copies the hex value to the clipboard on click and shows a toast. |
label | string | — | Accessible label override — falls back to the `color` value. |
ColorPicker
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled hex color value (e.g. `#F5B81E`). |
defaultValue | string | "#513DE5" | Uncontrolled initial hex value. |
onChange | (value: string) => void | — | Fires whenever a petal, the lightness arc, or a committed hex edit updates the color. |
disabled | boolean | — | Disables the swatch, pill, and wheel. |
multiple | boolean | false | Multi-select mode — the wheel adds colors to a list instead of committing one value. `value` / `onChange` are ignored. |
values | string[] | — | Controlled list of hex values (multi-select). |
defaultValues | string[] | [] | Uncontrolled initial list (multi-select). |
onValuesChange | (values: string[]) => void | — | Fires whenever a color is added or removed. |
minColors | number | 1 | Minimum colors to pick — drives the "Select X more" progress line. |
maxColors | number | 5 | Maximum colors — the centre petal locks once the list is full. |
showModeSwitch | boolean | true | Shows the `Color Wheel` / `Classic Picker` tabs at the top of the popover. Set `false` to lock the popover to one surface. |
mode | "wheel" | "picker" | — | Controlled popover surface. |
defaultMode | "wheel" | "picker" | "wheel" | Initial surface when uncontrolled. |
onModeChange | (mode: "wheel" | "picker") => void | — | Fires when the mode switch is toggled. |
label / caption / error / required | ReactNode / boolean | — | Uniform field shell shared with DurationInput and FileSizeInput. |