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

Lays out its children in a column or a row, spaced by a gap from the spacing scale.

ComponentsStack
contentstatic
<arc-stack>

Overview

Stack lays out its children in a column or a row with a gap from the spacing scale. You set `direction`, `gap`, `align` and `justify` as attributes in place of writing flexbox CSS. The host element is the flex container, and `render()` returns a bare `<slot>`, so Stack adds no DOM nodes of its own. With no attributes it's a column with a `md` gap and children stretched to its width. `wrap` lets a row wrap onto more lines. Use it for a set of tags or small cards. For columns that line up across rows, use CSS Grid.

Guidelines

Do

  • Combine `direction="horizontal"` with `justify="between"` for a toolbar-style row
  • Nest a horizontal stack inside a vertical one for rows within a column
  • Space children with `gap`, not margins

Don't

  • Don't use it for two-dimensional layouts where columns must line up. Use CSS Grid
  • Don't use `gap="xs"` between major sections. Keep it for tight clusters such as an icon and its label

Features

  • Gap scale: `xs`, `sm`, `md`, `lg`, `xl` and `2xl`, mapped to the `--space-*` tokens
  • `align` takes `start`, `center`, `end` or `stretch`
  • `justify` takes `start`, `center`, `end`, `between` or `around`

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