AhaSlides Design
v0.52.0React · Vue · Lit

Components · Layout

Flex

A flexbox container with the DS spacing scale baked into `gap` — direction, align, justify, wrap.

Examples

Direction
Justify
Align
Gap
Flex · direction row · gap middle · justify space-between · align center
One
Two
Three

API

PropTypeDefaultNotes
gapsmall | middle | large | number0Space between items — named DS step (8/16/24) or a raw pixel number
verticalbooleanfalseStack in a column — AntD's boolean shorthand for direction=column (direction wins if both set)
directionrow | row-reverse | column | column-reverserowMain-axis direction (flex-direction) — the full matrix; overrides `vertical`
alignstart | center | end | baseline | stretchstretchCross-axis alignment (align-items)
justifystart | center | end | space-between | space-around | space-evenlystartMain-axis distribution (justify-content)
wrapbooleanfalseAllow items to wrap onto multiple lines

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-flex';   // registers <aha-flex>

Agent feed for this component (absolute, fetchable anywhere): flex.agent.json · flex.md · flex.llms.txt

When to use

When to use
  • Flex — arranging a block of items in one dimension with consistent DS spacing
  • Grid — you need two-dimensional rows-and-columns, not a single flow
  • Space — you only need even gaps between a small inline set of items
Keep gaps on the named scale (small/middle/large) so spacing stays consistent across surfaces — reach for a raw pixel number only for a genuine one-off. Flex is layout, never decoration: it paints no background.
Surfaces
editor dashboard settings audience

Spec

Display flex · Gap scale small 8 · middle 16 · large 24 (or a raw px number) · Direction row · row-reverse · column · column-reverse (or `vertical` for column) · Align start · center · end · baseline · stretch (align-items) · Justify start · center · end · space-between/around/evenly