Skip to content
Gelatin UIAlpha

Color Format Field

Pro

Type one color as hex, RGB, HSL, or HSB. Pick the format in a Select, and the color stays the same.

  • Base UI
  • React Aria
  • 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

Color Format Field 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
46
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.

Put the format Select before or after the fields.

brand-color.tsx

ColorFormatField

<fieldset>
PropTypeDefaultDescription
disabledbooleanfalseTurns off the control: no focus, no edits, and the disabled look.
namestring—The form name: the form gets the color as hex (#RRGGBB, or #RRGGBBAA with alpha).
readOnlybooleanfalseThe user can focus and read the value, but cannot change it.
invalidbooleanfalseShows the invalid look and sets aria-invalid.
valuestring | Color—The color (controlled): a string ("#6E56CF", "hsl(250, 55%, 57%)") or a React Aria Color.
defaultValuestring | Color—The color at first (uncontrolled). Default #000000, or the color of a ColorPicker around it.
onValueChange—Runs on each committed change (blur, Enter, arrow keys), with the new Color.
colorFormat"hex""hsb""hsl""rgb"—The format (controlled): hex, rgb, hsl, or hsb.
defaultColorFormat"hex""hsb""hsl""rgb""hex"The format at first (uncontrolled). Default hex.
onColorFormatChange—Runs when people pick another format. The color stays the same.
alphabooleanfalseAdds an alpha field (0% to 100%) after the other fields.
labels—The words (COLOR_FORMAT_FIELD_LABELS), to translate them. Keep the object stable.
...props<fieldset> attributes—Every other attribute goes to the <fieldset>, with a ref.

ColorFormatFieldFormat

<button>
PropTypeDefaultDescription
classNamestring—
size"default""lg""sm"—
contentPropsOmit<SelectContentProps, "children">—Props of the format list (SelectContent): container, side, align, className...
itemProps—Props of the row of each format (SelectItem), and any data-* attribute.
From Base UISelect.TriggerBase UI docs
disabledboolean—Whether the component should ignore user interaction.
defaultOpenbooleanfalseWhether the select popup is initially open. To render a controlled select popup, use the open prop instead.
onOpenChange—Event handler called when the select popup is opened or closed.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

ColorFormatFieldInputs

<div>
PropTypeDefaultDescription
size"default""lg""sm""default"The height of each field: sm 28, default 32, lg 36.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ColorFormatFieldError

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.
  • Use it when people type or paste exact color values.
  • Use alpha to add an alpha field.
  • Use name to send the color as hex with a form.
TabMoves between the Select and the fields.
Up ArroworDown ArrowChanges the value of the focused channel field one step.
EnterCommits the typed value.

Built with

Installs with Color Format Field

  1. AddedColor Format Field, with Color Field, Input Group, Select.
Open the release