Skip to content

Inline

Horizontal layout primitive — a wrapping flex row with token-driven gap, align, and justify. Reach for it whenever you need things to flow left-to-right (RTL-safe — flows right-to-left under dir="rtl") with consistent spacing.

  • stable
  • since v0.1.0
  • 3.67 kB
  • primitive
  • layout
  • flex

Plain <div>; the visual ordering matches DOM order so screen readers and keyboard tab-stops follow what you see. Wraps cleanly under dir="rtl".

Preview
Open
tsx

gap accepts any space token (or a responsive map). Use rowGap / columnGap independently when the row distance should differ from the column distance after wrapping.

align is the cross-axis (vertical) alignment, justify is the main-axis (horizontal) distribution. Use justify="between" for toolbar-style “left items / right items” rows.

Preview
Open
tsx

By default wrap="wrap" lets children flow onto a new line when the row overflows. Switch to wrap="nowrap" to force a single row that scrolls or clips.

Preview
Open
tsx
PropTypeDefaultDescription
className
string
Additional class names appended after Cynosure's base classes.
style
CSSProperties
Inline style overrides merged last.
children
ReactNode
Inline children.
gap
Uniform gap in both axes. Falls back to `rowGap`/`columnGap` when set.
rowGap
Gap between wrapped rows. Overrides the row axis of `gap`.
columnGap
Gap between adjacent items on the inline axis. Overrides `gap`'s columns.
align
Responsive<InlineAlign>
Cross-axis alignment — maps to `align-items`. Supports `baseline` for text rows.
justify
Responsive<InlineJustify>
Main-axis distribution — maps to `justify-content`.
wrap
Responsive<boolean>
true
Allow items to wrap onto multiple lines.
padding
Padding on all four sides. Token from the spacing scale.
paddingX
Horizontal padding (left + right). Overrides `padding` on the X axis.
paddingY
Vertical padding (top + bottom). Overrides `padding` on the Y axis.
paddingTop
Padding on the top edge. Beats `padding` / `paddingY`.
paddingRight
Padding on the right (inline-end in RTL) edge.
paddingBottom
Padding on the bottom edge.
paddingLeft
Padding on the left (inline-start in RTL) edge.
margin
Margin on all four sides. Accepts the spacing scale or `"auto"`.
marginX
Horizontal margin (left + right). Use `"auto"` to centre.
marginY
Vertical margin (top + bottom).
marginTop
Margin on the top edge.
marginRight
Margin on the right edge.
marginBottom
Margin on the bottom edge.
marginLeft
Margin on the left edge.
width
Element width. Accepts a `SpaceToken`, `LengthValue`, or named alias.
height
Element height. Accepts a `SpaceToken`, `LengthValue`, or named alias.
minWidth
Minimum width — useful for preventing flex children from collapsing.
maxWidth
Maximum width — `"prose"` caps to a comfortable reading measure.
minHeight
Minimum height.
maxHeight
Maximum height.
background
Background colour. Use a `ColorToken` like `"bg.surface"` for theme awareness.
color
Text colour. Inherits unless set.
borderColor
Border colour. Pair with `borderWidth` to make the border visible.
borderWidth
Border thickness in scale steps.
borderStyle
Border line style.
borderRadius
Corner rounding token.
boxShadow
Drop-shadow token from the elevation scale.
opacity
Responsive<number | `${number}`>
Opacity 0–1. Use sparingly — prefer surface tokens over translucency.
overflow
How content that exceeds the box is handled.
overflowX
Horizontal-axis overflow control. Overrides `overflow` for the X axis.
overflowY
Vertical-axis overflow control.
display
CSS `display` value. `"contents"` removes the element's box from layout.
position
CSS `position`. Pair with `top`/`right`/`bottom`/`left` for placement.
top
Top inset (when positioned). Accepts a `SpaceToken`, `"auto"`, `"0"`, or `LengthValue`.
right
Right inset (when positioned).
bottom
Bottom inset (when positioned).
left
Left inset (when positioned).
zIndex
Stacking-context layer token (`"modal"`, `"tooltip"`, …).
gridColumn
Responsive<string>
Grid-column shorthand (e.g. `"1 / 3"`, `"span 2"`).
gridRow
Responsive<string>
Grid-row shorthand.
gridArea
Responsive<string>
Named grid area.
flex
Responsive<"1" | "none" | "auto" | "initial" | (string & {})>
Shorthand: `1 | auto | none | initial | <css>`. Resolves to `flex` on the child.
flexGrow
Responsive<number | `${number}`>
Grow factor inside a flex container.
flexShrink
Responsive<number | `${number}`>
Shrink factor inside a flex container.
flexBasis
Responsive<SizeValue | "content">
Initial main-axis size before grow/shrink.
alignSelf
Override `align-items` for a single child.
justifySelf
Override `justify-items` for a single child (grid).
order
Responsive<number | `${number}`>
Flex/grid child reorder index.
asChild
boolean
When `true`, renders the primitive's single React child via `Slot`, forwarding className/style/ref/event handlers onto it.
as
ElementType
"div"
Rendered intrinsic element or component.
ref
ForwardedRef<Element>
  • Toolbar / header bar: <Inline justify="between" align="center" /> with <Spacer /> between groups.
  • Tag clouds: see Wrap — it’s the wrap-first variant of Inline tuned for variable-width chips.
  • For vertical flow inside an Inline (e.g. label above value pairs), nest a <Stack> for each pair.