Skip to content

Flex

Category: Layout & primitives

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

Install: @helix-ui/core

import { Flex } from '@helix-ui/core';

status: stable · since: 0.1.0

Tags: primitive, flexbox, row, column, gap

[ child ][ child ][ child ] ← horizontal
child
child
child ← vertical (direction="column")
  • display — flex
  • width — auto
  • height — auto
  • intrinsicSize — flex container; sized by flow + children
  • stackable — true
  • fullBleed — false

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

Name Type Default Description
direction 'row' | 'row-reverse' | 'column' | 'column-reverse' row Flex direction.
align 'start' | 'center' | 'end' | 'stretch' | 'baseline' stretch Cross-axis alignment.
justify 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' start Main-axis alignment.
gap number | string — Gap between children. Numeric → space.N token.
wrap boolean false Allow wrapping.
inline boolean false Use inline-flex instead of flex.

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

Notes

  • Flex is presentational. Use Stack for vertically/horizontally arranged content lists.
Component Relation Note
Stack alternative Stack is opinionated for vertical/horizontal stacking.
Grid alternative Use Grid for 2-D layout.
Box sibling

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

“flex row with gap”

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