ColorPicker renders no element. It shares one color between the trigger and the popup. onValueChange gets a Color object, not a string.
fill-color.tsx
ColorPicker
| Prop | Type | Default | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| value | string | Color | — | The current value (controlled). | |||||||||||||||||||||||||||
| default | string | Color | — | The default value (uncontrolled). | |||||||||||||||||||||||||||
| slot | string | null | — | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit null value indicates that the local props completely override all props received from a parent. | |||||||||||||||||||||||||||
| on | — | Runs on each change, with the new value and the Base UI change details. | ||||||||||||||||||||||||||||
| children | — | The trigger, the content, or inline color components. A function gets { color }. | ||||||||||||||||||||||||||||
| labels | — | The words (COLOR_PICKER_LABELS), to translate them. Keep the object stable. | ||||||||||||||||||||||||||||
From Base UIPopover.RootBase UI docs | ||||||||||||||||||||||||||||||
| default | boolean | false | Whether the popover is initially open. To render a controlled popover, use the open prop instead. | |||||||||||||||||||||||||||
| open | boolean | — | Whether the popover is currently open. | |||||||||||||||||||||||||||
| on | — | Event handler called when the popover is opened or closed. | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
ColorPickerTrigger
<button>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||
| variant | "field""swatch" | "field" | field (default): a field with a swatch, the hex value, and a chevron. swatch: a 32px outline icon button with a 24px swatch. It has one size. | ||||||||||||||||||||||||||||||
| size | "default""lg""sm" | "default" | The height of the field: sm 28, default 32, lg 36. | ||||||||||||||||||||||||||||||
From Base UIPopover.TriggerBase UI docs | |||||||||||||||||||||||||||||||||
| id | string | — | ID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the popover in controlled mode (with the PopoverRoot triggerId prop). | ||||||||||||||||||||||||||||||
| handle | PopoverHandle<unknown> | — | A handle to associate the trigger with a popover. | ||||||||||||||||||||||||||||||
| payload | unknown | — | A payload to pass to the popover when it is opened. | ||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||||||||||||||||||||||||||||
ColorPickerContent
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | — | Show an arrow that points at the trigger. The gap grows from 4px to 8px. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | boolean | — | Put a clear layer under the popup (Base UI Popover.Backdrop), for example to dim it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show | boolean | — | Show a close button (a 24px ghost icon button) 10px from the top and the end. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding | "default""none""tight" | — | default: radius 14, 12px padding and 10px between the parts, 288px wide. tight: 4px padding and 4px between the parts, as wide as the content: a row of 28px actions (a plain Toolbar) with the 4px inset of the bar recipe, 38px high (the selection pill of the Quote Reply). none: no padding and no gap, as wide as the content: a panel that lays out its own parts edge to edge (a head with a rule, a scroll box, a docked composer: the Chat Popup). Give it a width and a height with layout classes; the body fills that height. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | PopupPartProps<PopoverBackdropProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<PopoverArrowProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| close | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| close | string | — | The accessible name of the close button. Translate it with the page. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UIPopover.PopupBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| initial | — | Determines the element to focus when the popover is opened. By default, focus moves to the first tabbable element inside the popup, except when the popover is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard. - false: Do not move focus. - true: Move focus based on the default behavior (first tabbable element or popup). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| final | — | Determines the element to focus when the popover is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anchor | — | An element to position the popup against. By default, the popup will be positioned against the trigger. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ColorPickerEyeDropper
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| children | ReactNode | — | The icon. Default: a pipette. | ||||
| on | — | Runs when the browser EyeDropper fails (not on a cancel). Show the user a message here. With no handler, the error goes to the nearest error boundary. | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
| EnterorSpace | On ColorPickerTrigger: opens the popover. |
|---|---|
| Escape | Closes the popover. |
| Arrow keys | ColorArea thumb: moves the thumb one step on each axis. With Shift, it moves a large step. |
| Arrow keys | ColorSlider thumb: moves the thumb one step. With Shift, it moves a large step. |
| Enter | ColorField: sets the typed value. |
Built with
Installs with Color Picker







