GitHub

Color Picker

Color selection with swatches, opacity, format options, and model binding.

<rhx-color-picker>

Examples

Basic

With Swatches

With Opacity

Formats

Inline

States

Model Binding

htmx Integration

Pick a color to save...

Properties

Property Type Default Description
rhx-for ModelExpression - ASP.NET Core model expression for two-way binding
name string - The form field name
value string - The current color value (hex)
rhx-label string - Label text
rhx-format string hex Color format: hex, rgb, hsl
rhx-swatches string - Comma-separated preset color values
rhx-opacity bool false Show opacity/alpha slider
rhx-inline bool false Always show the picker (no trigger button)
rhx-disabled bool false Whether the color picker is disabled

Accessibility

  • Trigger button has an aria-label describing the current color value.
  • Keyboard navigation is supported within the swatch grid using arrow keys.
  • The selected color value is announced to screen readers on change.
  • Disabled state sets aria-disabled="true" on the trigger.