Skip to content

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.json

Preview

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.json

GitHub 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.json

Usage

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.

PropTypeDefault
valuestring | Color—
defaultValuestring | Color—
onChange(color) => void—