Color Input

GitHub

Native color input built on the shared labeled input field.

Installation

bash
pnpm dlx shadcn@latest add @cs/color-input

Usage

tsx
import { ColorInput } from "@/components/cs/color-input"
tsx
<ColorInput name="brandColor" label="Brand color" />

API Reference

ColorInput

Renders a native color input using the shared labeled input field.

Props

NameTypeDefaultDescription
defaultValuestring--
errorstring | null | undefined-Validation error message for the field.
iconReactNode-Icon displayed inside the input on the left.
inputClassNamestring | undefined-Additional classes applied to the native input control.
labelReactNode-Field label and fallback placeholder.
onValueChange(value: string) => void--
orientation"vertical" | "horizontal" | "responsive" | null | undefined"vertical"Layout of the field label and input control.
valuestring--

Dependencies