Getting startedComponentsDesign tokensThemingTheme synthesizerFrameworksAccessibilityUtilitiesServer renderingBrowser supportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting startedFrameworksServer renderingDesign tokensThemingTheme synthesizerTypographyUtilitiesAll componentsAccessibilityBrowser supportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Color Picker

Picks any color from a drag area or a typed hex value.

ComponentsColor Picker
inputinteractive
<arc-color-picker>

Overview

ColorPicker has a saturation/lightness area where users click or drag a crosshair, a hue slider across the full 360 degrees under it, and a hex input with a preview swatch for typing a known color. Pass a `presets` array and a row of swatches appears under the hex input, with the active one outlined in the primary text color. Use presets for a brand palette or frequent colors. The area still allows any color. `arc-input` fires on every frame of a drag across the area or the hue slider, so use it for a live preview. `arc-change` fires once the color is committed (pointer released, preset clicked, or a valid hex entered), so use it for anything expensive, like a save. Both carry the hex string.

Guidelines

Do

  • Set a `label`, especially when there's more than one picker on the page
  • Set the initial color with `value` in 6-digit hex (for example `#4d7ef7`)
  • Put the picker in a popover or dropdown when horizontal space is tight

Don't

  • Don't pass 3-digit hex shorthand (`#f00`). The component expects all six digits
  • Don't use it when users choose from a fixed set. Use a select or a radio group
  • Don't give it more than about 20 presets. The row wraps and gets crowded
  • Don't put it in a container narrower than 260px. The area and the slider need the room

Features

  • Values go in and come out as 6-digit hex strings. The HSL conversion happens inside
  • The hex input checks its value on blur or Enter. An invalid value reverts to the current color
  • Dragging uses `setPointerCapture`, so a drag keeps working when the pointer leaves the area
  • Disabled pickers drop to 50% opacity and ignore the pointer

Preview

Usage

This component needs JavaScript. Use the Web Component or a framework wrapper.

<arc-color-picker
  label="Theme Color"
  value="#4d7ef7"
></arc-color-picker>

<script>
  const picker = document.querySelector('arc-color-picker');
  picker.presets = ['#4d7ef7', '#22c55e', '#ef4444', '#eab308'];
  // Live preview — fires on every drag frame
  picker.addEventListener('arc-input', e => {
    document.documentElement.style.setProperty('--accent-primary', e.detail.value);
  });
  // Committed color — fires once on release
  picker.addEventListener('arc-change', e => {
    console.log('Committed:', e.detail.value);
  });
</script>

API

valuestring'#4d7ef7'
Current color as a 6-digit hex string (e.g. #4d7ef7). Reflected as an attribute.
namestring''
disabledbooleanfalse
Disables all interaction, reducing opacity to 40% and blocking pointer events.
labelstring''
Label text displayed above the picker in uppercase accent font.
presetsstring[][]
Array of hex color strings to display as quick-select swatches below the hex input.
readonlybooleanfalse
Prevents changing the color via the area, hue slider, hex input, or swatches while the picker stays focusable and the value still submits.
size'sm' | 'md' | 'lg''md'
Control size. md is the default; sm and lg scale the swatch and trigger.
formAssociatedbooleantrue
propertiesobject{ // flag(), unlike `disabled`. The exclusion in props.js is specifically // about form-associated *platform* semantics: a `disabled` content // attribute that is merely present makes the element actually disabled // per the HTML spec, and formDisabledCallback assigns the property back, // so no converter can win. Neither of these is platform-mapped: // `required` is enforced by _computeValidity() below and `readonly` by // each component's own interaction handlers, so the stock converter buys // nothing here and costs the usual bug: `required="false"` read as true, // blocking submission of a form the author meant to leave optional. // Finding #48's shape, across all 26 form controls at once. required: flag(false), readonly: flag(false), }
Lit merges static properties up the prototype chain, so every consumer gets these without declaring them. required participates in constraint validation below; readonly reflects for styling and is enforced by each component's interaction handlers (the mixin can't know which gestures mutate state).
autoValidatesbooleantrue
Components that run their own constraint-validation logic (pattern checks, range checks) opt out of the automatic required sync by overriding this to false, and own the whole validity flag set instead.
form
validity
validationMessage
requiredbooleanfalse

Methods

checkValidity()boolean
Whether the control currently satisfies its constraints, per the native constraint-validation API. Fires invalid on the element when it does not, and reports nothing to the user.
reportValidity()boolean
As checkValidity(), but also shows the browser's validation message against the control when it fails.

Events

arc-input
Fired continuously as the color changes, including every frame of a drag across the saturation area or hue track. Use for live previews. event.detail.value contains the hex string.
arc-change
Fired once the color is committed: the pointer released after a drag, a preset clicked, or a valid hex typed and blurred. Use for anything expensive. event.detail.value contains the hex string.

See also