Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Color Swatch Picker
Grid of swatches for picking a named color.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/color-swatch-picker.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/color-swatch-picker.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/color-swatch-picker.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/color-swatch-picker.
Import
import { ColorSwatchPicker, ColorSwatchPickerItem} from "@/components/ui/color-swatch-picker"example.tsx
import { ColorSwatchPicker, ColorSwatchPickerItem,} from "@/components/ui/color-swatch-picker"export function Example() { return ( <ColorSwatchPicker defaultValue="#3b82f6"> <ColorSwatchPickerItem color="#3b82f6" /> <ColorSwatchPickerItem color="#22c55e" /> <ColorSwatchPickerItem color="#ef4444" /> </ColorSwatchPicker> )}API Reference
ColorSwatchPicker
React Aria ColorSwatchPicker.
| Prop | Type | Default |
|---|---|---|
| value | string | Color | — |
| defaultValue | string | Color | — |
| onChange | (color) => void | — |