DocsComponentsTemplatesThemesGitHub

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.json

Guidelines

  • Pass your brand colors as swatches.

Props

PropTypeRequired
valuestringNo
defaultValuestringNo
onChange(hex: string) => voidNo
swatchesstring[]No
labelstringNo
hintReact.ReactNodeNo
classNamestringNo
styleReact.CSSPropertiesNo

Edit this example on GitHub