Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Primitives
  2. Grid
  3. Usage

Grid

Usage

Overview
Grid defines column (and optional row) tracks with design tokens—ideal for dashboards, queue boards, and sidebar + main shells. Prefer it when alignment must hold in two axes or when track ratios are structural (2:1, fixed metric column + flexible peers). Prefer FlexBox with item={FlexItem.*} for one-dimensional flex rows and scroll hosts inside a pane.
When to use
  • Equal or ratio column tracks (GridTemplate.EqualThirds, TwoOne, ThreeOne, EqualTenths).
  • Queue-board metric rows with tokenized fixed leading columns (QueueMetricsStandard, QueueMetricsEct).
  • Sidebar + main layouts (SidebarStartMain, MainSidebarEnd) with collapseBelow inside a container query host.
  • Card galleries that add columns as a pane grows (AutoFillMinItem).
When not to use
  • Simple vertical stacks or single toolbars—FlexBox and item={FlexItem.*} are easier.
  • Scrollable flex children inside an already-defined row—use FlexItem.FillScroll on Box / FlexBox, not grid tracks.
  • Ad hoc grid-template-columns in consumer CSS—request or use an existing GridTemplate.
Flex children inside grid cells
Grid positions cells; flex behavior inside a cell still uses Box / FlexBox props. Put paint on Box inside Grid / GridItem. For a cell that should grow and scroll, wrap content in FlexBox item={FlexItem.FillScroll} with a definite height on the grid row or cell host—not className flex rules.
Layout needPrefer
2:1 or 3:1 columnsGrid template={GridTemplate.TwoOne} or ThreeOne
Ten equal columnsGrid template={GridTemplate.EqualTenths}
Queue metrics (231px / 337px leading track)QueueMetricsStandard / QueueMetricsEct
One row, one child eats leftover height + scrollsFlexBox item={FlexItem.FillScroll} inside the cell
Toolbar + growing body in a columnOuter FlexBox; toolbar item={FlexItem.Fixed}, body FillScroll
Before and after (flex basis → GridTemplate)
Anatomy
Grid container, optional GridItem for span, Box children for content and paint. Enable containerType={ContainerType.InlineSize} on an ancestor when using collapseBelow.
Best practices
  • Do use gap from GridGap tokens.
  • Do pair collapseBelow with container queries when grids live in resizable panes.
  • Don't pass background, border, or style on Grid / GridItem—use Box inside cells.
  • Don't duplicate ratio layouts with flex and basis when a GridTemplate exists.
Accessibility
  • Keep DOM order aligned with reading order; avoid dense flow={GridFlow.RowDense} when focus path matters.
  • Maintain spacing for text zoom in metric-heavy boards.
Related Components
  • Box — FlexItem, alignSelf, and paint inside cells.
  • Empty state for sparse grids.
Previous
Error Boundary / Accessibility
Next
Grid / API and Development
On this page
Overview
When to use
When not to use
Flex children inside grid cells
Before and after (flex basis → GridTemplate)
Anatomy
Best practices
Accessibility
Related Components