Skip to main content
Choose colors with a saturation and brightness area, preset palettes or channel sliders. Use a full-width field, a compact color circle or an inline panel, and choose how the value is saved.

Choose your controls

Four panel layouts, optional opacity and your own palette.

Choose your output

Save HEX, RGB, RGBA, HSL or HSLA strings.

Start with one field

The default is an advanced panel with HEX output. Opacity is off. Click anywhere on the field to open the panel. The format selector offers HEX, RGB and HSL; the screen-color picker appears when the browser supports it.

Choose a panel layout

A saturation and brightness area with a hue slider. Add opacity, channel inputs or preset swatches when needed.
showSwatches() adds circular presets to the advanced or sliders panel. On a grid panel, it changes the palette to circular swatches. Use gridColors() to choose the colors shown in any palette.

Choose the field appearance

Full field, icon or color circle

iconOnly() shows a palette icon colored with the current value. swatchOnly() shows a color circle without an outer input frame. Both omit the value text. Alternatively, use trigger('icon') or trigger('swatch') directly.

Sizes, variants and rounding

The main field shares FLEX Text Input’s appearance: three sizes, four variants, rounding and an optional focus outline. These settings affect the field; panelWidth() and panelRadius() configure the panel separately.
See Configuration for shared appearance settings. The picker supports light and dark themes. Its format selector uses the FLEX Select control, and its value inputs use shared FLEX input controls.

Always-visible panel

inline() displays the controls directly in the form and removes the opening trigger. closeOnSelect() does not hide an inline panel.

Formats and saved values

The saved format and the editing format are separate. format() determines how new color selections are written to the field. Changing the format selector changes the editing controls without changing this setting.
format('hex'), format('rgb'), format('rgba'), format('hsl') and format('hsla') are equivalent configuration choices. hsla() enables opacity automatically; rgba() does not. Use alpha() with RGBA output.

Limit the editing formats

A single allowed format hides the selector. If no output format was explicitly set, the first allowed format becomes the output format. An explicitly configured output format must be included in allowedFormats(). With opacity disabled, rgba and hsla configuration choices become rgb and hsl. Duplicate choices are removed.
Existing valid color strings are not converted simply by opening a form. Conversion to the configured output happens when the user changes the color. allowedFormats() controls editing choices; it does not reject an existing color solely because it uses another supported representation.

Opacity

Opacity is off by default. Enable it to show the opacity slider and preserve transparency. opacity() is an alias for alpha().
With opacity off, a transparent color entered interactively becomes opaque. A transparent value submitted directly to the server fails the field’s validation. Use an opaque default when opacity is off.

Custom palettes

Show brand colors alongside the full picker:
Or offer only a compact preset interface:
gridColors() accepts up to 512 valid color strings and removes duplicate strings. null or an empty list restores the default palette. Generated grids allow 1–32 columns and 1–32 rows, with at most 512 cells in total. Grid dimensions do not generate additional colors when you supply a custom palette.
A palette configures the choices shown to the user; it is not a server-side allowlist. If your application requires one of a fixed set of saved values, add an explicit validation rule.

Show only the controls you need

The screen-color picker remains available in advanced and sliders layouts even when the selector or value fields are hidden. With a visible selector, its button sits beside that selector. Otherwise, it sits beside the sliders. It never needs a separate full-width row.
This displays one color-string input. When opacity is enabled, it also displays a separate opacity number input. With channelFields(true), RGB and HSL have individual channel inputs; HEX has one string input.
This hides the numeric/string input section and its format selector. In the sliders layout, the format selector is independent of showFields(); use showFormatSelector(false) to hide it there.
showChannelLabels(false) hides the headings and numeric readouts above sliders. showValue(false) hides the main field’s color text. Neither removes the controls’ accessible labels.
The screen-color picker is available only in advanced and sliders layouts, when enabled and supported by the browser. Unsupported browsers hide the button and retain the other controls.

Panel position and motion

The default dropdown is aligned to the start edge of the field with a small gap. It follows the field while scrolling or resizing, stays inside the viewport, and can flip above the field when there is not enough room below. Use animationDuration(0) to disable transitions. The picker also respects reduced-motion preferences.

Validation and database storage

The field stores a color string, or an empty value when optional. Use a nullable string column for optional colors; a length of 128 accommodates every accepted value. No JSON column or color-specific model cast is required. The built-in server rule checks color syntax and channel ranges. Supported inputs are: Named colors such as red, four-digit HEX, CSS variables, URLs, CSS expressions and strings longer than 128 characters are not accepted. Modern space-separated CSS color notation is not supported. Empty values are allowed unless you use required().
Invalid text in the picker shows an error and keeps the previous valid form value. Add your application’s rules with rule() or rules(); use Data & validation for form saving guidance.

Read-only and disabled fields

Both prevent opening a dropdown picker or changing inline controls. Read-only keeps the field’s normal saving behavior; disabled fields follow Filament’s disabled-field saving behavior. Decide separately whether the value should be included when your form is saved.

React to a changed color

Dragging the color area updates its preview as you move and commits the field value on release. Sliders commit on their change event. Use the normal Filament state callbacks for application behavior.

Keyboard controls

You can also drag the color area and sliders with a pointer or touch. Opening the nested format selector keeps the color picker available.

Configuration reference

These are the Color Picker’s configuration methods. Setters with a value parameter also accept a closure, so each field can resolve its settings from the current form or record. Invalid layout names, unsupported formats and out-of-range panel or grid settings are rejected when the field configuration is resolved.
Last modified on October 20, 2026