Colors

Color primitives — a click-to-copy swatch and an inline flower-wheel color picker.

Sizes

Brand

Click any swatch to copy its hex code to the clipboard.

Installation
$Terminal
npx shadcn@latest add https://sdk-components.thesqd.com/r/color-swatch.json https://sdk-components.thesqd.com/r/color-picker.json
Usage
`ColorSwatch` is a click-to-copy chip. `ColorPicker` is an inline swatch + hex pill that opens a flower-wheel popover (petals = hue/saturation, curved arc = lightness).
TSImport
import { ColorSwatch } from "@/components/ui/color-swatch";
import { ColorPicker } from "@/components/ui/color-picker";
TSExample
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} />;
}
Composition
Anatomy of the color primitives.
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" + Done
Swatches
`ColorSwatch` ships three sizes — `sm`, `default`, `lg` — and copies its hex on click by default. Pass `copyOnClick={false}` for purely decorative use.

Sizes

Brand

Click any swatch to copy its hex code to the clipboard.

Palette table
Brand color palette presented as a DataGrid with swatch / hex / category columns.
SwatchHex CodeCategory
#341756Primary
#F9635DPrimary
#513DE5Primary
#A960FFPrimary
#F2AF39Primary
#CC4291Primary
#BCB3F9Secondary
#DEC1FFSecondary
#EB8EC3Secondary
#FFDB9BSecondary
#FFA8A4Secondary
#FFB48BSecondary
Color picker
`ColorPicker` is an inline swatch + hex pill built from the same `h-9 rounded-md` cards as `DurationInput` and `FileSizeInput`. The pill flips into an editable hex input with a ✓ to commit; the swatch is a `Popover` trigger that opens the flower-wheel panel (via the shared Popover primitive) — petal rings set hue/saturation, the curved arc sets lightness, and the footer pins the click-to-copy hex readout to the bottom-left corner. The `Color Wheel` / `Classic Picker` tabs at the top of the popover flip to `ColorPickerPanel` — a classic saturation/brightness square with hue and alpha tracks, a HEX/RGB/HSL/OKLCH format select and an eyedropper (its color math is ported from [Fluid Functionalism](https://www.fluidfunctionalism.com/docs/color-picker); the chrome is rebuilt on Squad primitives). Hide the tabs with `showModeSwitch={false}`. Drives a controlled hex string via `value` / `onChange`.

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.

Multi-select picker
Pass `multiple` to pick several colors in one pass. The hex pill becomes a stacked-chip summary, the wheel's centre petal adds the live color to the list (✓ once it's in, locked once the list is full), and the panel carries the flow: a selected-swatch row you can click to remove from, and a `Select X more` line that counts down to `minColors` before offering **Done**. `maxColors` caps the list. Drives a controlled `string[]` via `values` / `onValuesChange`.

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.

Classic picker mode
The popover carries `Color Wheel` / `Classic Picker` tabs at the top. `defaultMode="picker"` opens straight onto `ColorPickerPanel` — a saturation/brightness square, hue and alpha gradient tracks, a HEX/RGB/HSL/OKLCH format select and an eyedropper (Chromium only; the button hides itself elsewhere). Its color math is ported from the [Fluid Functionalism](https://www.fluidfunctionalism.com/docs/color-picker) picker; the chrome is rebuilt on Squad primitives so the install stays one file. Hide the tabs with `showModeSwitch={false}`.

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.

API Reference
Props exposed by ColorSwatch and ColorPicker.

ColorSwatch

PropTypeDefaultDescription
colorstring—Any CSS color value (hex, rgb, hsl, or a named color).
size"sm" | "default" | "lg""default"Visual footprint of the chip.
copyOnClickbooleantrueCopies the hex value to the clipboard on click and shows a toast.
labelstring—Accessible label override — falls back to the `color` value.

ColorPicker

PropTypeDefaultDescription
valuestring—Controlled hex color value (e.g. `#F5B81E`).
defaultValuestring"#513DE5"Uncontrolled initial hex value.
onChange(value: string) => void—Fires whenever a petal, the lightness arc, or a committed hex edit updates the color.
disabledboolean—Disables the swatch, pill, and wheel.
multiplebooleanfalseMulti-select mode — the wheel adds colors to a list instead of committing one value. `value` / `onChange` are ignored.
valuesstring[]—Controlled list of hex values (multi-select).
defaultValuesstring[][]Uncontrolled initial list (multi-select).
onValuesChange(values: string[]) => void—Fires whenever a color is added or removed.
minColorsnumber1Minimum colors to pick — drives the "Select X more" progress line.
maxColorsnumber5Maximum colors — the centre petal locks once the list is full.
showModeSwitchbooleantrueShows 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 / requiredReactNode / boolean—Uniform field shell shared with DurationInput and FileSizeInput.