ColorPicker
Swatch grid plus hex field.
Code
import * as React from 'react';
import { ColorPicker } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 280,
}}
>
<ColorPicker label="Project color" defaultValue="#7A4DFF" />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { ColorPicker } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/color-picker.jsonGuidelines
- Pass your brand colors as
swatches.
Props
| Prop | Type | Required |
|---|---|---|
value | string | No |
defaultValue | string | No |
onChange | (hex: string) => void | No |
swatches | string[] | No |
label | string | No |
hint | React.ReactNode | No |
className | string | No |
style | React.CSSProperties | No |