Skip to content

Gradient Picker

Pro

Make a linear, radial, or conic CSS gradient. Move, add, and remove color stops on a track, and set the color and angle.

  • Base UI
  • React Aria
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Gradient Picker needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
87
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Compose the parts in the order people use them: type, preview, track, stop row, color editor, and angle. name sends the CSS text with a form.

background-gradient.tsx

GradientPicker

<div>
PropTypeDefaultDescription
childrenReactNode—The parts. Default: type, preview, track, stop row, editor, and angle.
value—The gradient, controlled.
defaultValueDEFAULT_GRADIENTThe first gradient, uncontrolled. Default: blue to violet, linear at 90°.
onValueChange—Each change: a type, an angle, a stop move, color, add, or remove. cancel stops it.
activeStopstring—The id of the stop that the editor, the position field, and Remove act on, controlled.
defaultActiveStopstring—The first active stop. Default: the first stop from the start.
onActiveStopChange—
disabledbooleanfalse
namestring—The form name: the form sends the CSS text (linear-gradient(90deg, …)).
formstring—The form of the hidden input, for a picker outside its form.
labels—The words (GRADIENT_PICKER_LABELS). Keep the object stable.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

GradientPickerType

<div>
PropTypeDefaultDescription
classNamestring—
fullWidthbooleantrue
orientation"horizontal""vertical"—
rounded"default""full"—
size"default""lg""sm""xs""sm"
From Base UIRadioGroupBase UI docs
disabledbooleanfalseWhether the component should ignore user interaction.
readOnlybooleanfalseWhether the user should be unable to select a different radio button in the group.
requiredbooleanfalseWhether the user must choose a value before submitting a form.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

GradientPickerPreview

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

GradientPickerTrack

<div>
PropTypeDefaultDescription
classNamestring—
From Base UISlider.RootBase UI docs
disabledbooleanfalseWhether the slider should ignore user interaction.
formatNumberFormatOptions—Options to format the value.
localeLocalesArgument—The locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

GradientPickerStop

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

GradientPickerStopLabel

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

GradientPickerPosition

<div>
PropTypeDefaultDescription
classNamestring—
From Base UINumberField.RootBase UI docs
idstring—The id of the input element.
allowOutOfRangebooleanfalseWhen true, direct text entry may be outside the min/max range without clamping, so native range underflow/overflow validation can occur. Step-based interactions (keyboard arrows, buttons, wheel, scrub) still clamp.
smallStepnumber0.1The small step value of the input element when incrementing while the alt key is held. Snaps to multiples of this value when snapOnStep is enabled.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

GradientPickerAdd

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—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.
spinnerPlacement"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"—
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether 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.

GradientPickerRemove

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—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.
spinnerPlacement"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"—
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether 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.

GradientPickerEditor

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

GradientPickerAngle

<div>
PropTypeDefaultDescription
onValueCommitted—The end of a change: a release, a key, a typed value. Not on Escape.
range"signed""wrap"—wrap (default): 0 to 359. signed: −180 to 180. Both wrap at the ends.
stepnumber—The step of a drag and of the arrow keys, in degrees. Use a step that divides 360. Default 1.
snapStepnumber—The snap of Shift (a drag and Shift + arrow), in degrees. Default 15. Use a multiple of step: the value then snaps to the step grid, which would undo a snap between two steps.
variant"default""row""row"default: the dial beside its text. row: a 32px panel row with a 24px dial at the end.
size"default""lg""sm"—The dial: sm 24, default 64, lg 96. In a row: the row height, 28, 32, or 36.
disabledboolean—
readOnlyboolean—The value shows and can be focused, read, and submitted, but not changed.
namestring—The form name of the hidden range input.
formstring—The form of the hidden range input, for a dial outside its form.
localestring—The locale of the number format.
formatNumberFormatOptions—The format of the shown value. Default: the narrow degree unit with the digits of the step.
getAriaValueText—The spoken value (aria-valuetext). Default: "135 degrees" in the locale.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it when people make a gradient, not only one color.
  • Use name to send the CSS text (linear-gradient(90deg, …)) with a form.
  • Use gradientToCss(value) to paint the result on the page.
Arrow keysMoves the focused stop 1%.
Shiftarrow keysMoves the focused stop 10%.
HomeorEndMoves the focused stop to the next stop, or to the end.
DeleteorBackspaceRemoves the focused stop. A gradient keeps 2 stops.
Add
indicator · 200ms · the new stop thumb grows from 0.5 and fades in
Thumb
press · 100ms · the thumb grows to 1.1 on hover, 1.25 on drag, and 1.5 when active
  1. AddedGradient Picker, with Angle Dial, Button, Color Area, Color Field, Color Picker, Color Slider, Direction, Number Field, Segmented Control.
Open the release