Primitives

Color picker

Square, hue strip, swatches, hex and the eyedropper; inline or in a popover. Drag or arrow keys.

A Wavi Pro component

The live example is open to everyone. The source comes with a Wavi Pro licence: add it with one command, or copy it below.

Get Pro

Level 1 · Bay A

#0d9488

Import#

The package for everything else, and the Pro component from where `add` puts it:

your-component.tsx
import { FormField } from "@waveinno/ui";
import { ColorPicker, ColorPickerPopover } from "@/components/wavi-pro/color-picker";

Props#

Read from the source of this version, so they match the code exactly.

<ColorPicker>

pro/color-picker.tsx
PropTypeDefaultDescription
valuestring—
defaultValuestring"#4f46e5"
onValueChange(hex: string) => void—
swatchesstring[] | falseDEFAULT_SWATCHESQuick choices under the strip; `false` for none.
classNamestring—

<ColorPickerPopover>

pro/color-picker.tsx
PropTypeDefaultDescription
valuestring—
defaultValuestring"#4f46e5"
onValueChange(hex: string) => void—
swatchesstring[] | false—Quick choices under the strip; `false` for none.
classNamestring—
aria-labelstring"Colour"

<FormField>

src/components/ui/form-field.tsx
PropTypeDefaultDescription
labelReact.ReactNode—
htmlForstring—The control's id, so clicking the label focuses it.
requiredboolean—
hintReact.ReactNode—
errorReact.ReactNode—
warningReact.ReactNode—
successReact.ReactNode—
count{ value: number; max: number }—Character counter, e.g. { value: note.length, max: 240 }.
classNamestring—
childrenrequiredReact.ReactNode—

Add it to your project#

With your licence key, this writes the component to components/wavi-pro/ and installs anything it needs:

$ npx @waveinno/ui add color-picker --key <your licence key>

Source#

Or copy the file yourself. It imports only from @waveinno/ui, lucide-react and React (and Radix where noted).

The source comes with Wavi Pro

One payment for every Pro component, block and template, with every update.

Get Pro

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui