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

Icon

Renders an SVG icon by name from the Phosphor or Lucide library, or from icons you register yourself.

ComponentsIcon
contentstatic
<arc-icon>

Overview

Icon looks up `name` in the icon registry, runs the SVG through a sanitizer that strips `<script>` elements and `on*` handler attributes, and renders the result in its shadow root. Sanitized SVGs are cached, so each one is processed once. Each of the 3,400+ icons is its own module (Lucide icons average 500 bytes and Phosphor icons 660), and `<arc-icon name="star">` fetches only `star.js`. Importing `arc-icon` brings no icon library with it, only the nine glyphs ARC UI's own buttons draw (close, chevrons, overflow, edit, play and pause). The icons ship separately in `@arclux/arc-ui-icons`. It has two libraries: **Phosphor Icons** (phosphoricons.com), 1,512 glyphs drawn as filled paths, and **Lucide** (lucide.dev), a community fork of Feather Icons with 1,896 stroke-based glyphs. Click any icon in the browser below to copy its name. Install it and import a pack. One line registers it, and if nothing else has been selected it becomes the active library, so `<arc-icon name="star">` works on the next line: ```js import '@arclux/arc-ui-icons/phosphor'; ``` Nothing is selected by default. Until a pack registers, a named icon renders its slot fallback (unless it's one of the nine built-in glyphs) and the registry logs a warning saying why. Before v4 both packs were vendored inside `@arclux/arc-ui`, where they were 88% of the published files and 44% of the unpacked bytes of every install. To switch libraries for the whole page, use the `iconRegistry` API or the `<arc-icon-library>` element: ```js // JavaScript API import { iconRegistry } from '@arclux/arc-ui'; iconRegistry.use('lucide'); // switch all icons to Lucide (no data loaded until icons render) ``` ```html <!-- Declarative (place anywhere in the document) --> <arc-icon-library name="lucide"></arc-icon-library> ``` You can register your own icons, such as a logo, on top of the active library and use them alongside its icons. Icons registered with `set()` resolve with no network request: ```js iconRegistry.set({ 'my-logo': '<svg viewBox="0 0 24 24">...</svg>', 'custom-chart': '<svg viewBox="0 0 24 24">...</svg>', }); ``` If your app uses a handful of icons, skip the pack registration and import those glyphs directly. That pulls in one module per icon and no resolver at all: ```js import { iconRegistry } from '@arclux/arc-ui'; import check from '@arclux/arc-ui-icons/phosphor/check'; import x from '@arclux/arc-ui-icons/phosphor/x'; iconRegistry.set({ check, x }); ``` To load a whole library in one import, for an icon picker say, use the `all` entry points: ```js import phosphor from '@arclux/arc-ui-icons/all/phosphor'; // loads all ~1,500 icons import lucide from '@arclux/arc-ui-icons/all/lucide'; // loads all ~1,900 icons ```

Guidelines

Do

  • Give an icon a `label` when it carries meaning, such as a status or an action
  • Leave `label` off decorative icons so screen readers skip them
  • Size icons with the `size` prop, not CSS
  • Register custom icons with `iconRegistry.set()` before they first render

Don't

  • Don't render SVG strings from user input without sanitizing them yourself first
  • Don't use `xl` for icons in running text. `sm` or `md` matches body copy
  • Don't set both `name` and slot content. When the name resolves, the slot is ignored
  • Don't let an icon carry critical information on its own. Pair it with visible text
  • Don't hardcode fill or stroke colors in registered SVGs. Use `currentColor` so they follow the text color

Features

  • Sizes: `xs` (12px), `sm` (16px, the default), `md` (20px), `lg` (24px) and `xl` (32px)
  • Takes its color from the parent through `currentColor`
  • Renders its default slot when the registry has no icon by that name, so an inline SVG works as a fallback
  • With `label`, the icon gets `role="img"` and that `aria-label`. Without it, `role="presentation"` and `aria-hidden="true"`

Preview

Usage

<!-- Basic usage, once a pack is registered (see the Registry API tab) -->
<arc-icon name="star" size="sm"></arc-icon>
<arc-icon name="heart" size="md"></arc-icon>
<arc-icon name="gear" size="lg"></arc-icon>

<!-- Accessible icon with label -->
<arc-icon name="warning" size="md" label="Warning"></arc-icon>

<!-- Switch to Lucide globally -->
<arc-icon-library name="lucide"></arc-icon-library>

API

namestring''
Icon name to look up in the icon registry. When provided, renders the matching SVG. When empty, falls back to slotted content.
size'xs' | 'sm' | 'md' | 'lg' | 'xl''sm'
Icon dimensions: xs (12px), sm (16px), md (20px), lg (24px), xl (32px).
labelstring''
Accessibility label. When provided, sets role="img" and aria-label. When empty, sets role="presentation" and aria-hidden="true".

See also