Usage
| Configuration | Purpose | Emphasis |
|---|---|---|
FlexBox alias | Shorthand flex container | Still token-driven gaps and alignment |
| Padding / margin scales | Rhythm | Prefer axis shorthand when horizontal and vertical differ |
| Background + border | Card-like regions | Don’t mimic interactive cards without proper focus semantics |
| Positioned overlays | Contextual layers | Manage zIndex with design tokens; avoid arbitrary stacks |
FlexBox is Box with flex display preset—choose it to reduce boilerplate, not to change semantics.
gap and wrapping over fixed widths when content varies.onClick alone without accessibility parity.@prepared911/ui, Box and FlexBox drop pointer, mouse, context-menu, and keyboard handlers. A context-menu region is Interactable inside ContextMenuTrigger. Focus and blur still pass.item={FlexItem.*} on Box or FlexBox instead of CSS-module flex shorthand. Recipes bundle grow, shrink, basis, and (for scroll hosts) minHeight, minWidth, and overflow. Use alignSelf when one child breaks out of the parent cross-axis alignment.
FlexItem | Typical use |
|---|---|
Fixed | Toolbars, chips, fixed-width columns (flex: 0 0 auto) |
Fill | Default growing row (flex: 1 1 auto) |
FillZeroBasis | Equal flex siblings (flex: 1 1 0) |
FillNoShrink | Truncation-friendly main pane (flex: 1 0 auto) |
FillScroll | Column body that scrolls in place (BX-3) |
template={GridTemplate.*} instead of flex basis tricks on Box.
BlockSize.ExtraLargeControl sets a 40px block size (--space-40), aligned with ButtonSize.ExtraLarge and InputSize.ExtraLarge. Use it on height or minHeight for bordered FlexBox pills (for example Call Dock number and timer rows) instead of padding on a shorter box.
InlineSize.ControlColumn sets a 56px inline size (--space-56) on width, minWidth or maxWidth for a column that stacks an Extra Large control over its caption without shifting when the label toggles.
Give the outer column a definite block size (height={BlockSize.Full} inside a sized parent, or a viewport step). On the row that should absorb leftover space and scroll, set item={FlexItem.FillScroll} (or explicit grow, shrink, minHeight={BlockSize.Zero}, and overflow={Overflow.Auto}). shrink alone only clears the inline-axis minimum; block-axis flex scrolling needs minHeight={BlockSize.Zero}.
Do
zIndex, Background, and Border rather than raw values.className from apps or remotes to restyle Box; it is deprecated outside the design system. Use enum props, regionClass with a *.region.module.scss file for token-only host paint, shipped parts, or request a prop via the find-pattern skill.gradient={GradientPaint.*} applies Chroma's paint_wash_<id> recipe: a diagonal wash over --color-wash-ground, paired light text through --color-fg-on-wash-*, mirrored under right-to-left layout, and dropped under prefers-contrast: more and forced colors. Only blocks inside @prepared911/ui set this prop from their own state enum. Shells and remotes pass state into the block; they do not choose a wash on Box or FlexBox directly.
Text and Icon inside a wash use the default foreground tokens; do not add a color prop to force dark ink on the wash. Pair the wash with a label or icon so state is never conveyed by color alone. When a Light wash needs a stroke, use border-transient. Do not set background on the same node as gradient.
background fills, ensure contrast for text. On a state wash, the recipe applies the fg-on-wash ladder; still pair the wash with a label or icon (BX-9).overflow: hidden), verify keyboard users can still reach hidden interactive elements or provide another path.toZoomStep and pass the result on zoom. The helper rounds down so content never overflows the cell. Do not use 0.4 on desktop UI; zoom shrinks text with the layout.