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 Swatch

Color sample square with a label, for token docs.

ComponentsColor Swatch
contentstatic
<arc-color-swatch>

Overview

ColorSwatch renders a color sample square with a label underneath, for design token documentation, palette displays, and theme previews. The color is set via the `color` property and applied directly as a `background-color` inline style, so it accepts any valid CSS color value: hex, rgb, hsl, or named colors. The label defaults to displaying the color value itself when no explicit label is provided, which suits token reference tables. The label is rendered in monospace (`--font-mono`) at 11px with text overflow ellipsis, so long color names or values do not break the layout. The swatch box includes a subtle border and a hover effect that brightens the border and adds a blue glow shadow. Three size presets (`sm`, `md`, `lg`) control the swatch dimensions: 32px, 48px, and 64px respectively. The border radius also scales with size: `--radius-sm` for small, `--radius-md` for medium, and `--radius-lg` for large. The color box includes `role="img"` with an `aria-label` for accessibility.

Guidelines

When to use

  • Use in a flex or grid row to display a palette of related colors
  • Provide a human-readable label for design token documentation (e.g. "Primary Blue")
  • Use the lg size for hero palette displays and sm for inline token tables
  • Group swatches by category: accent colors, neutrals, semantic colors
  • Use hex values for consistency in token reference docs

When not to use

  • Do not use color swatches for interactive color picking; this is a display-only component
  • Do not set transparent or semi-transparent colors without a visible background behind the swatch
  • Do not mix different swatch sizes in the same row; keep sizes consistent within a group
  • Do not use very long labels that will be truncated. Keep labels under 10 characters
  • Do not rely solely on color to convey meaning. Always pair with a label

Features

  • Accepts any CSS color value (hex, rgb, hsl, named) via the color property
  • Auto-displays the color value as the label when no explicit label is set
  • Three size presets: sm (32px), md (48px), lg (64px) with matching border radii
  • Hover effect with border brightening and blue glow shadow
  • Monospace label with text-overflow ellipsis for long values
  • `role="img"` with `aria-label` for screen reader accessibility
  • CSS parts (swatch, color, label) for external styling

Preview

Usage

<arc-color-swatch color="#4d7ef7" label="Primary"></arc-color-swatch>
<arc-color-swatch color="#8b5cf6" label="Violet"></arc-color-swatch>

API

colorstring'#4d7ef7'
Any valid CSS color value applied as the swatch background
labelstring''
Display label below the swatch; falls back to the color value if empty
size'sm' | 'md' | 'lg''md'
Controls swatch dimensions: sm (32px), md (48px), lg (64px)

See Also