Componentpickers0.9 KB gzipZero dependencies
Color Picker
Palette swatch picker with framing and active mark.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add color-pickerOr install the full npm package:
npm install bigbulluiUsage
tsx6 lines
import { ColorPicker } from "@/components/ui/color-picker"; <ColorPicker defaultValue="#BC3A28" onValueChange={(c) => console.log(c)}/>Source code
color-picker.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "#BC3A28") |
| onValueChange | (color: string) => void | Callback invoked on value change. |
| colors | string[] | Configures colors. (Default: DEFAULT_STUB_COLORS) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |