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

Stack

Flexbox layout component for vertical or horizontal stacking with token-based spacing.

ComponentsStack
contentstatic
<arc-stack>

Overview

Stack is a layout primitive that arranges child elements in a vertical or horizontal flex container with token-based spacing. Instead of writing flexbox CSS for every layout, you set `direction`, `gap`, `align`, and `justify` attributes, which map to the design system's spacing scale. The component renders no inner wrapper. The `:host` element is the flex container, and `render()` returns a bare `<slot>`, so Stack adds no extra DOM nodes. Gap values (`xs` through `2xl`) map to `var(--space-*)` tokens, so spacing stays consistent without magic numbers. Stack suits form layouts, card groups, button rows, and any composition where items need uniform spacing. The `wrap` attribute enables flex wrapping for responsive grids, and combining `direction="horizontal"` with `justify="between"` creates common toolbar-style layouts.

Guidelines

When to use

  • Use Stack to replace inline flexbox styles for consistent spacing
  • Combine direction="horizontal" with justify="between" for toolbar layouts
  • Use the wrap attribute for responsive card or tag grids
  • Nest stacks for complex layouts: horizontal inside vertical
  • Use gap tokens instead of margins on child elements

When not to use

  • Do not use Stack when CSS Grid is more appropriate (2D layouts with column alignment)
  • Do not add margin to Stack children; use gap instead
  • Do not use gap="xs" for major layout sections; reserve xs for tight clusters like icon+text
  • Do not nest more than 3 levels deep; consider a dedicated layout component instead

Features

  • Vertical and horizontal flex direction via attribute
  • Token-based gap scale: xs, sm, md, lg, xl, 2xl mapping to `--space-`* tokens
  • Alignment control with start, center, end, and stretch options
  • Justification control including space-between and space-around
  • Flex wrap support for responsive layouts
  • Zero inner DOM: host element is the flex container directly

Preview

NEW Stack Layout Cancel Submit

Usage

<arc-stack direction="vertical" gap="md">
  <arc-text>Item one</arc-text>
  <arc-text>Item two</arc-text>
  <arc-text>Item three</arc-text>
</arc-stack>

<arc-stack direction="horizontal" gap="sm" align="center" justify="between">
  <arc-button variant="ghost">Cancel</arc-button>
  <arc-button>Save</arc-button>
</arc-stack>

API

direction'vertical' | 'horizontal''vertical'
Flex direction: vertical is column, horizontal is row
gap'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl''md'
Gap between children, maps to --space-* tokens
align'start' | 'center' | 'end' | 'stretch''stretch'
Cross-axis alignment (align-items)
justify'start' | 'center' | 'end' | 'between' | 'around''start'
Main-axis alignment (justify-content)
wrapbooleanfalse
Enable flex-wrap for responsive wrapping

See Also