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