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

Button

Action button with three variants for action hierarchy and prefix and suffix slots for icons. For links, slot a real anchor, which works before JavaScript loads.

ComponentsButton
inputhybrid
<arc-button>

Overview

Button has three variants for an action hierarchy: `primary` for the one most important action, `secondary` for a visible alternative with less emphasis, and `ghost` for tertiary actions. The `prefix` and `suffix` slots hold icons or other inline elements beside the label, such as a search icon or an arrow. For links, slot a real `<a>` as the button's only child. The anchor is ordinary HTML in the initial markup, so the link works with JavaScript disabled and before the element upgrades. On a slow connection your landing-page button is clickable straight away, not after hydration. Button adopts the anchor on upgrade and styles it as the control, so there is only ever one link in the accessibility tree. The `href` attribute still works and renders an `<a>` in the shadow root. Use it inside app shells behind a login, where JavaScript is a given and the extra markup is noise. On public, indexed or first-load-critical pages, slot the anchor instead: with the destination on the custom element, the link can't exist without JavaScript. With no `href` and no slotted anchor, Button behaves as a normal button for form submission and other actions. The sizes (sm, md, lg) change the padding. The font size and the minimum touch target are the same in all three. Use lg for hero sections, md for general UI and sm for compact toolbars and inline actions.

Guidelines

Do

  • Pair primary with secondary or ghost so the most important action stands out
  • Use the prefix slot for leading icons and suffix for trailing arrows or indicators
  • Write labels that say what happens, in two or three words: "Create project", "Read the API docs"

Don't

  • Don't put two primary buttons side by side. Use one primary per group of actions
  • Don't use ghost for the most important action. It is too faint
  • Don't make a navigation link a plain button. Screen readers and search engines need a real link
  • Don't put a second link inside a slotted anchor. The adopted anchor is already the control
  • Don't disable a button without saying why the action is unavailable

Features

  • Labels are uppercase in the label font
  • Primary glows on hover, and every variant shrinks slightly while pressed
  • Disabled buttons are dimmed and ignore pointer and keyboard input

Preview

Create project Bookmark Read the docs

Usage

Its events and state need JavaScript, so use the Web Component or a framework wrapper for those.

<script type="module" src="@arclux/arc-ui"></script>

<!-- Slot a real <a>: the link works without JS and before hydration -->
<div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap;">
  <arc-button variant="primary" size="lg"><a href="/docs/getting-started">Get Started</a></arc-button>
  <arc-button variant="secondary"><a href="/docs/components">View Docs</a></arc-button>
  <arc-button variant="ghost"><a href="/docs/tokens">Learn More</a></arc-button>
</div>

<!-- href still works — best inside app shells where JS is guaranteed -->
<arc-button variant="primary" href="/dashboard">Dashboard</arc-button>

<!-- With prefix icon (icons go inside the anchor in the slotted form) -->
<arc-button variant="secondary">
  <svg slot="prefix" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" width="16" height="16"><path d="M5 4a2 2 0 012-2h6a2 2 0 012 2v14l-5-2.5L5 18V4z"/></svg>
  Bookmark
</arc-button>

API

hrefstring''
When provided, the button renders as an <a> element instead of a <button>, making it a navigational link. This is the recommended approach for any action that takes the user to a new page or section.
variant'primary' | 'secondary' | 'ghost''primary'
Controls the visual weight and emphasis. Primary is a filled button with a neon glow hover suited for the top-level CTA. Secondary uses a bordered outline for supporting actions. Ghost renders with no border or background, ideal for low-priority or tertiary actions.
size'sm' | 'md' | 'lg''md'
Sets the button size. Large (lg) is intended for hero sections and high-impact areas. Medium (md) is the default for general UI. Small (sm) fits compact toolbars, table rows, and inline contexts.
disabledbooleanfalse
When true, dims the button and prevents all pointer and keyboard interaction. Applies reduced opacity and removes hover/focus effects. Consider pairing with a tooltip that explains why the action is unavailable.
loadingbooleanfalse
Shows a spinner and disables the button. Use for async operations like form submission or API calls.
type'button' | 'submit' | 'reset''button'
Sets the HTML button type attribute. Use submit inside forms to trigger native form submission, or reset to clear form fields. Only applies when no href is set (link buttons ignore this).

See also