Componentpickers0.9 KB gzipZero dependencies

Color Picker

Palette swatch picker with framing and active mark.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add color-picker

Or install the full npm package:

npm install bigbullui

Usage

tsx6 lines
import { ColorPicker } from "@/components/ui/color-picker"; <ColorPicker  defaultValue="#BC3A28"  onValueChange={(c) => console.log(c)}/>

Source code

color-picker.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxcolor-picker.tsx100 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface ColorPickerProps extends React.HTMLAttributes<HTMLDivElement> {  value?: string;  defaultValue?: string;  onValueChange?: (color: string) => void;  colors?: string[];  className?: string;} const DEFAULT_STUB_COLORS = [  "#BC3A28",  "#17130C",  "#F6F0E0",  "#ECE3CC",

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { ColorPicker } from "@/components/ui/color-picker"; <ColorPicker />
PropTypeDescription
valuestringControlled value.
defaultValuestringInitial value when uncontrolled. (Default: "#BC3A28")
onValueChange(color: string) => voidCallback invoked on value change.
colorsstring[]Configures colors. (Default: DEFAULT_STUB_COLORS)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.