Components
Color Picker
A hand-drawn color picker with rough-styled swatches and hex input.
Stroke Color
Installation
package manager
npx shadcn add https://bydefaulthuman.fun/r/color-picker.jsonProps
PropTypeDefaultDescription
labelstring—
Optional label displayed above the picker.
defaultValuestring"#3b82f6"Initial selected color (uncontrolled mode).
valuestring—
Controlled value of the selected color.
onChange(color: string) => void—
Callback fired when a color is selected or typed.
swatchesstring[]preset paletteArray of color swatches displayed in the grid.
classNamestring—
Additional Tailwind classes applied to the component.
idstring"color-picker"Optional stable id used for sketch seeding and accessibility.
themeCrumbleTheme—
Overrides the global Crumble theme for this instance.
fillstring—
Custom fill color for rough elements.
strokestring—
Custom stroke color for rough elements.
strokeMutedstring—
Muted stroke color (used for borders).
Custom swatches
Custom stroke and fill
Accessibility
This component preserves semantic input behavior. Ensure labels are provided when used in forms and that color selection is not the only means of conveying meaning.
Examples
import { ColorPicker } from "@/components/crumble/ui/color-picker";
<ColorPicker
label="Pick a color"
defaultValue="#3b82f6"
onChange={(color) => console.log(color)}
/>;