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.
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-base, 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-8).overflow: hidden), verify keyboard users can still reach hidden interactive elements or provide another path.