Skip to content

Internal ID software / Layout

Stack

Rhythm as a decision: one gap between the children, taken from the spacing steps.

Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/layout.tsx. From the old system: Stack in @id-identity-as/ui/layout.

Example

gap inline-2
inside a group
direction row
section-1 from the group above
gap inline-2
inside a group
direction row
section-1 from the group above
import { Stack } from '@/components/software/layout';

<Stack gap="section-1">
  <Heading level={1}>Ordrer</Heading>
  <Stack gap="inline-3">
    <Text>24 åbne ordrer.</Text>
    <Text tone="muted">Opdateret i dag.</Text>
  </Stack>
</Stack>

Props

PropTypeDefaultWhat it does
gapSpace'inline-4'The space between the children: 'none', 'seam', 'inline-1' to 'inline-5' or 'section-1' to 'section-4'.
direction'column' | 'row''column'Column stacks downwards. Row sets the children side by side and wraps.
align'start' | 'center' | 'end' | 'stretch''stretch'How the children sit across the direction.
asElementType'div'The element to render, such as "ul" or "section".

Do

  • Use an inline step inside a group and a section step between groups.
  • Nest stacks: a section stack of groups, each an inline stack.

Do not

  • Do not put a margin on a child to adjust the rhythm. Change the gap.
  • Do not look for a step between 20 and 40 px. There is none.

Accessibility

  • It adds no role. Pass as="ul" or as="section" when the content is a list or a region.

Tokens it uses

  • space.inline.1
  • space.inline.2
  • space.inline.3
  • space.inline.4
  • space.inline.5
  • space.section.1
  • space.section.2
  • space.section.3
  • space.section.4
  • space.seam