ColorPicker

molecules

Per-event brand color picker (sets CSS custom properties). Replaces legacy color-picker.xsl.

ARIA Role: group

Demo

Demo for ColorPicker (molecules)

Per-event brand color picker (sets CSS custom properties). Replaces legacy color-picker.xsl.

Props

PropTypeRequiredDefaultDescription
valuestringNoSelected color (hex)
onChange(color: string) => voidYesColor change handler
disabledbooleanNofalseDisabled state
labelstringNoField label
presetColorsstring[]NoPreset color swatches

TypeScript Interface

interface ColorPickerProps {
  value?: string;
  onChange: (color: string) => void;
  disabled?: boolean;
  label?: string;
  presetColors?: string[];
}

Assertions (NASA Rule 5)

  • [aria]Color swatches must have aria-label with color name(WCAG 1.1.1)
  • [aria]Provide aria-valuenow, valuemin, valuemax, valuetext(WCAG 1.3.1)
  • [keyboard]Arrow keys, Enter, and Escape must be supported(WCAG 2.1.1)
  • [validation]Hex format: /^#[0-9A-Fa-f]{6}$/(NASA Rule 5)

Usage

Import

import { Colorpicker } from '@epasslive/design-system'

Basic

<Colorpicker />

With Variants

<Colorpicker variant="primary" size="md" />