Skip to content
LayoutGenerated from the public API

Inline

A row that wraps and gaps predictably, and collapses to a column on narrow screens.

@luc/ui/layout

Examples

Gaps and alignment

A row that wraps. The gap is the same scale `Grid` and `Stack` use, and alignment is one prop rather than a class on each item.

gap=xs

Return

Volatility

Sharpe

gap=sm

Return

Volatility

Sharpe

gap=md

Return

Volatility

Sharpe

gap=lg

Return

Volatility

Sharpe

Alignment

`baseline` is the one that earns its keep: a caption, a value and a chip sit on one line of type instead of on one box edge.

align=center

Lookback

200 weeks

weeks

align=baseline

Lookback

200 weeks

weeks

align=end

Lookback

200 weeks

weeks

Distribution

Justification is what turns a cluster into a row: `between` puts the label on one edge and the action on the other, which is the header pattern a card repeats forever.

justify=start
Draft

61 instruments

justify=center
Draft

61 instruments

justify=end
Draft

61 instruments

justify=between
Draft

61 instruments

Wrapping

`wrap` is the difference between a row that grows downwards and a row that keeps its height. Both boxes below are narrower than their contents on purpose.

wrap
BTC/USDETH/USDSOL/USDAAPLMSFTNVDA
wrap=false
BTC/USDETH/USDSOL/USDAAPLMSFTNVDA

A metadata row

The composition it was written for: label and value pairs, a vertical rule between groups, and a status badge at the end — all on one line that wraps when it must.

Lookback

200 weeks

Universe

US large cap

Live

Usage

import { Inline } from "@luc/ui/layout";
<Inline gap="sm" align="baseline">
  <Text variant="caption" tone="muted">Lookback</Text>
  <Text variant="body">200 weeks</Text>
</Inline>

One row, one gap, one alignment — and `justify` when the row has two ends to hold apart.

Package setup — peer requirements, the stylesheet and the provider — is on installation.

API

Read from the published TypeScript API, so a prop that is not listed here does not exist and a default that is listed is the one the compiler sees.

Exported symbols
ExportKindSignature
Inline6 documented props({ className, gap, align, justify, wrap, as, ...props }: InlineProps) => import("@types/react").JSX.Element

Inline props

Type: InlineProps

Values the compiler reads from the declaration.

Inline props
PropTypeDefaultNotes
align?Align | undefined—
as?"div" | "label" | "li" | "nav" | "span" | "ul" | "footer" | "header" | undefined—
children?ReactNode—
gap?Gap | undefined—
justify?Justify | undefined—
wrap?boolean | undefined—Allow items to wrap onto multiple lines. Default `true`.

Guidelines

Do

  • Use `Inline` for a row of things that belong together: a label and its value, a group of actions, a set of filters.
  • Let a row whose contents can grow wrap (`wrap`, the default), and keep `wrap={false}` for a toolbar that must not reflow.
  • Prefer `align="baseline"` when the row is text: it puts a caption, a value and a unit on one line of type.

Don't

  • Do not use an `Inline` where the order is meaningful and should be announced — an ordered sequence is `Stack as="ol"`.
  • Do not fix the height of a wrapping row: the wrap is the point, and the second line gets clipped.
  • Do not spread three or more peers with `justify="between"`: it turns a cluster into a bar with holes in it.

Accessibility

A row is a `div` (or whatever `as` names) with flex on it: the items are announced in source order, and nothing becomes a landmark. A row of interactive controls that is one group needs a name — `role="group"` with an `aria-label`, or the Actions family's `Toolbar`, which brings the roving-focus contract with it.

Family

Layout

Space, rhythm and the surfaces a page is made of.

10 documented entries in this family. Open the family index

Luc UI v1.0Inlinedark theme