Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-color-picker.json --yes

Color picker

Pro

A painted area and channel sliders that choose one colour, for React and Tailwind CSS. Part of Goop Pro.

Open a swatch, drag in the area or along the hue, type a value or pick a preset; the colours are read back, and which picker is open. The label and the project are our own sample rows; the colours are kept only on this page.

When to use

  • A painted area and channel sliders that choose one colour.
  • Also called: color input.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Color picker on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-color-picker.json --yes
PROMPT
Add the Goop Color picker to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { useState } from 'react';
import { ColorPicker } from '@/components/ui/goop/color-picker';
import { Field } from '@/components/ui/goop/field';

function CalendarColour() {
  const [colour, setColour] = useState('eb5757');
  return (
    <>
      <div className="flex items-center gap-1.5">
        <ColorPicker label="Calendar colour" value={colour} onValueChange={setColour} />
        <span>Site visits</span>
      </div>
      <Field label="Project colour" orientation="vertical">
        <ColorPicker variant="field" label="Project colour" defaultValue="4cb782" alpha />
      </Field>
    </>
  );
}
  • Also known as: ColourPicker, ColorInput, Input type="color", SwatchPicker.
  • For a label's, a calendar's or a project's colour leave variant out (the swatch, default) beside its name; in a settings form use variant="field" inside a Field. Never a native colour input.
  • height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
value?stringThe colour, controlled: hex, rgb(…) or hsl(…) words.
defaultValue?stringThe first colour, uncontrolled.
onValueChange?(value: string) => voidHears the chosen colour as #rrggbb (#rrggbbaa when it is not opaque) on every change.
variant?'default' | 'field' = 'default'default: the swatch, the quiet 36 px button with a 14 px dot; field: the text field's 40 px box, the colour and its value.
label?stringNames the trigger and the panel; "Colour" by default.
name?stringThe form field's name: a hidden field sends the colour as #rrggbb (empty while none is chosen).
alpha?boolean = falseAdds the opacity track.
presets?readonly string[]Colours to offer in a row under the field; nine label colours when left out, none when empty.
disabled?boolean = falseDims the trigger; nothing opens.
className?stringReaches the trigger.
open?booleanThe panel open, controlled.
defaultOpen?booleanThe panel open at first.
onOpenChange?(open: boolean) => voidHears the panel open and close.
container?HTMLElement | nullWhere the panel is portalled; the end of <body> when left out.
type?'button' | 'submit' | 'reset'
onClick?(event: MouseEvent) => void
  • State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-state=open, data-placeholder

Keyboard

KeyWhat it does
Enter SpaceOpen the panel
Arrow keysMove the area's thumb 1 % (with Shift 10 %): across for saturation, up and down for brightness
Home EndSaturation to none or full
PageUp PageDownBrightness to full or none
Enter (in the field)Apply the typed value; unreadable words stay, marked invalid
Arrow keys, Home/End (in the presets)Move to the next, the first or the last pill and choose it
EscapeClose the panel and return to the trigger

Accessibility

  • The native element answers the keyboard.
  • hover, active: the browser's own (:hover, :active): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
focus-visiblethe attribute data-focus-visible
checkedthe attribute aria-checked
indeterminatethe attribute aria-checked
expandedthe attribute data-state=open
openthe attribute data-state=open
disabledthe prop disabled
placeholder-shownthe attribute data-placeholder

Motion

  • The part sets its own motion: add no transition or animation of your own.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/color-picker.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-color-picker.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.