Skip to content

Flex

Flex

<Flex direction="row" align="center" justify="between" gap={4}>
<Logo />
<Nav />
</Flex>

Install: @helixui/core

import { Flex } from '@helixui/core'

status: stable · since: 0.1.0

Tags: primitive, flexbox, row, column, gap

Anatomy

[ child ][ child ][ child ] ← horizontal
child
child
child ← vertical (direction="column")

Layout

  • displayflex
  • widthauto
  • heightauto
  • intrinsicSizeflex container; sized by flow + children
  • stackabletrue
  • fullBleedfalse

Visual

A flex container with direction, align, justify, gap, and wrap exposed as props that map to design tokens.

Props

NameTypeDefaultDescription
direction'row' | 'row-reverse' | 'column' | 'column-reverse'rowFlex direction.
align'start' | 'center' | 'end' | 'stretch' | 'baseline'stretchCross-axis alignment.
justify'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'startMain-axis alignment.
gapnumber | stringGap between children. Numeric → space.N token.
wrapbooleanfalseAllow wrapping.
inlinebooleanfalseUse inline-flex instead of flex.

Tokens used

space.1, space.2, space.3, space.4, space.5, space.6, space.8

Accessibility

Notes

  • Flex is presentational. Use Stack for vertically/horizontally arranged content lists.

Composes with

ComponentRelationNote
StackalternativeStack is opinionated for vertical/horizontal stacking.
GridalternativeUse Grid for 2-D layout.
Boxsibling

Prompt examples

These are the AI prompt → JSX mappings used by the helixui prompt DSL and integrations like Cursor / Claude Code.

horizontal row of items

“flex row with gap”

<Flex direction="row" gap={3} align="center">{children}</Flex>