Components
Loading preview...
Color input field with labels, descriptions, validation, and HSL channel editing.
npx shadcn@latest add https://21st.dev/r/hero_ui/heroui-color-fieldimport { ColorField, Description, Label } from "@/components/ui/heroui-color-field";
export default function WithDescription() {
return (
<div className="flex min-h-screen w-full items-center justify-center overflow-hidden bg-background p-8">
<div className="flex flex-col gap-4">
<ColorField className="w-[280px]" defaultValue="#3B82F6" name="color">
<Label>Primary Color</Label>
<ColorField.Group>
<ColorField.Input />
</ColorField.Group>
<Description>Enter your brand's primary color</Description>
</ColorField>
<ColorField className="w-[280px]" defaultValue="#F59E0B" name="accent-color">
<Label>Accent Color</Label>
<ColorField.Group>
<ColorField.Input />
</ColorField.Group>
<Description>Used for highlights and CTAs</Description>
</ColorField>
</div>
</div>
);
}
export { WithDescription };