Components
Toggle sidebar
Flux Pro component
This component is only available in the Pro version of Flux.

Color picker

Let users pick a color from a swatch palette, drag a saturation/value canvas, or paste a hex value. Perfect for theme settings, brand-color pickers, and any place users need to choose a color.

Copy to clipboard
<flux:color-picker wire:model="brand" />

Basic usage

The default trigger is a text input that accepts any CSS color format. The swatch button opens a visual picker popover. Press while the input is focused to open the picker via keyboard.
The input accepts hex (#ff5733), bare hex without the hash (ff5733), RGB (rgb(255 87 51)), comma-separated RGB (255, 87, 51), HSL, and named CSS colors like tomato.
Copy to clipboard
<flux:color-picker value="#0ea5e9" />
Copy to clipboard
<flux:color-picker wire:model="brand" />

Format

Pick the output format using the format prop. Supported values: hex (default), hexa (hex with alpha), rgb, rgba (RGB with alpha), hsl, hsla (HSL with alpha). Alpha-aware formats automatically render an alpha slider in the popover.

hex
rgba
hsl
Copy to clipboard
<flux:color-picker format="hex" /><flux:color-picker format="rgba" /><flux:color-picker format="hsl" />

Sizes

The color picker supports three sizes that match other form components.

Copy to clipboard
<flux:color-picker /><flux:color-picker size="sm" /><flux:color-picker size="xs" />

Button trigger

Use type="button" for a simpler trigger that displays the selected color and opens the popover on click. Useful for compact toolbars or swatches-only pickers where typing isn't needed.

Copy to clipboard
<flux:color-picker type="button" />

Custom swatches

Replace the default 24-color Tailwind palette with your own brand colors. Pass an array of hex strings to the :swatches prop. You can also pass [value, label] pairs for accessible swatch labels.

Copy to clipboard
<flux:color-picker :swatches="['#ef4444', '#22c55e', '#3b82f6', '#f59e0b', '#a855f7']" /><!-- With [value, label] pairs for accessible swatch labels --><flux:color-picker :swatches="[['#ef4444', 'Red'], ['#22c55e', 'Green'], ['#3b82f6', 'Blue']]" />

No swatches

Pass :swatches="false" to hide the default swatch grid entirely. The popover will only show the SV area, hue slider, and hex input.

Copy to clipboard
<flux:color-picker :swatches="false" />

Swatches only

Pass child sub-components to replace the default popover layout entirely. Useful for "pick a tag color" or "pick a calendar event color" use cases where freeform color selection isn't needed.

Tag color
Copy to clipboard
<flux:color-picker type="button" label="Tag color">    <flux:color-picker.swatches>        <flux:color-picker.swatch value="#ef4444" label="Red" />        <flux:color-picker.swatch value="#f97316" label="Orange" />        <flux:color-picker.swatch value="#f59e0b" label="Amber" />        <flux:color-picker.swatch value="#22c55e" label="Green" />        <flux:color-picker.swatch value="#3b82f6" label="Blue" />        <flux:color-picker.swatch value="#8b5cf6" label="Violet" />        <flux:color-picker.swatch value="#64748b" label="Slate" />        <flux:color-picker.swatch value="#000000" label="Black" />    </flux:color-picker.swatches></flux:color-picker>

Custom layout

Compose flux:color-picker.area, flux:color-picker.slider, flux:color-picker.input, and flux:color-picker.swatches in any order to build a fully custom popover layout.

Copy to clipboard
<flux:color-picker>    <div class="flex flex-col gap-3">        <flux:color-picker.area />        <flux:color-picker.slider channel="hue" />        <flux:color-picker.input placeholder="#000000" />    </div></flux:color-picker>

Dropper

Add the dropper prop to render a button that lets users pick a color from anywhere on the screen. Uses the browser's EyeDropper API — automatically disabled in unsupported browsers.

Copy to clipboard
<flux:color-picker dropper />

Clearable

Add the clearable prop to render a clear (X) button on the trigger when a value is set.

Copy to clipboard
<flux:color-picker clearable />

Copyable

Add the copyable prop to render a clipboard-copy button on the trigger. One click copies the color value in the configured format. Only available with the default input trigger.

Copy to clipboard
<flux:color-picker copyable />

Disabled

Prevent interaction and visually dim the trigger.

Copy to clipboard
<flux:color-picker disabled />

Invalid

Auto-detected from the field's error bag when bound via wire:model, or set manually with the invalid prop.

Copy to clipboard
<flux:color-picker invalid />

Reference

flux:color-picker

Prop
Description
wire:model
Binds the color picker to a Livewire property. The value is a CSS color string in the configured format. See the wire:model documentation for more information.
value
Initial value as any CSS color string. Auto-normalized to the configured format on display.
name
Generates a hidden form input with this name for native form submission (no wire:model required).
format
Output format. Options: hex (default), hexa, rgb, rgba, hsl, hsla. Alpha-aware formats automatically render an alpha slider in the popover.
type
Trigger type. Options: input (default), button. The default input trigger lets users type or paste a color directly. The button trigger shows the value and opens the popover on click.
placeholder
Placeholder text for the input trigger. Default: format-specific (e.g. #000000 for hex).
size
Trigger size. Options: sm, xs. Default: base.
:swatches
Custom swatch palette as an array of hex strings or [value, label] pairs, or false to hide the default swatch grid entirely.
dropper
Render a dropper button in the popover that lets users pick a color from the screen. Uses the EyeDropper API — automatically disabled in unsupported browsers. Default: false.
clearable
Render a clear (X) button on the trigger when a value is set. Default: false.
copyable
Render a clipboard-copy button on the trigger. Only available with the default input trigger. Default: false.
label
Field label. Forwarded to flux:with-field.
description
Field description. Forwarded to flux:with-field.
disabled
Disable the picker. Default: false.
invalid
Mark the trigger as invalid. Auto-detected from the field's error bag when bound via wire:model.

flux:color-picker.area

Prop
Description
class
Additional CSS classes applied to the area element.

flux:color-picker.slider

Prop
Description
channel
The color channel this slider controls. Options: hue (default), alpha.

flux:color-picker.input

Prop
Description
placeholder
Placeholder text for the text input. Default: format-specific (e.g. #000000).

flux:color-picker.swatches

Prop
Description
class
Additional CSS classes applied to the swatches container.

flux:color-picker.swatch

Prop
Description
value
The color value as a CSS color string (e.g. #ef4444).
label
Human-readable label for the swatch. Used as the aria-label and hover tooltip. Defaults to the value.

flux:color-picker.eye-dropper

Prop
Description
class
Additional CSS classes applied to the eye dropper element. Automatically disabled in browsers that don't support the EyeDropper API.
Copyright © 2026 Wireable LLC ·Terms of Service
Built with by
Caleb Porzio and Hugo Sainte-Marie