jixoai-ui
the terminal design language
loading the style sheet…
Skip to content
docs · print medium: screen

registry:ui · Layout

grid — blowout-proof tracks, honest disclosure

The Layout family's GRID primitive: two-dimensional track arrangement over the typed space ladder. Numeric cols compile to the blowout-proof repeat(N, minmax(0, 1fr)) atom (the grid-law vocabulary); the rows lane carries the DISCLOSURE vocabulary (collapse = 0fr, open = 1fr — the 0fr-to-1fr collapse every drawer rides; grid-template-rows animates, height:auto never does). Bespoke track forms stay in surface modules — an open string domain cannot be pre-atomized.

install — grid

$npx jixoai-ui add grid

https://ui.jixoai.com/r/grid.json

repeat(N, minmax(0, 1fr)) 0fr → 1fr disclosure lane token-bound gap rungs structural props · never-ambient

usage

Usage

cols sets equal track count (1–12); rows carries the single named row state — collapse (0fr) or open (1fr); gap rides the same typed ladder as stack.

Grid usage
<script lang="ts">
  import Grid from '@ui/grid';
</script>

<!-- three equal, blowout-proof columns -->
<Grid cols={3} gap="12">
  <Card>…</Card>
  <Card>…</Card>
  <Card>…</Card>
</Grid>

<!-- the disclosure lane: an expander row that animates honestly -->
<Grid rows={open ? 'open' : 'collapse'} gap="8">
  <button onclick={() => (open = !open)}>toggle</button>
  <div>…</div>
</Grid>

grid

Equal tracks under the minmax(0, 1fr) law — the playground swaps the count; a long word in one cell can never widen its track at its siblings' expense.

cell 1
a-long-unbreakable-identifier
cell 2
cell 3
grid-usage.svelte svelte
<script lang="ts">
  import Grid from '@ui/grid';
</script>

<Grid cols={3} gap="8">
  {#each cells as cell}<Cell>{cell}</Cell>{/each}
</Grid>

disclosure

The disclosure lane — 0fr → 1fr

Grid can animate a row's height between zero and full without measuring anything: the row track runs 0fr (collapse) → 1fr (open) and the content keeps min-height: 0 / overflow: hidden. The site's own canvas code drawers, terminal drawers and hero disclosures ride this lane (with the rAF motion interpolant where the browser's own transition falls to the Chrome clock-freeze).

grid · disclosure lane

The lane's content — riding the grid's own 0fr→1fr track. No max-height hacks, no measured pixels: the track IS the animation (instantly by default — the family ships no duration; transition the track yourself for a smooth morph), and the content simply lives in it (min-height: 0 / overflow: hidden on the lane — without them the content's own minimum floors the 0fr track and the collapse never closes; WITH them the residue is only the lane's own box — padding + border).
grid-disclosure-demo.svelte svelte
<script lang="ts">
  import Grid from '@ui/grid';
  let open = $state(false);
</script>

<button class="pill" onclick={() => (open = !open)}>
  {open ? 'collapse the lane' : 'open the lane'}
</button>
<Grid rows={open ? 'open' : 'collapse'} class="w-full">
  <div class="border border-border p-3 text-[12px] min-h-0 overflow-hidden">…the lane's content…</div>
</Grid>

a11y

Accessibility

Like stack, a plain div carrying layout only — no role, no announcements. The disclosure lane is a LAYOUT affordance: pair it with your own button + aria-expanded/aria-controls wiring (the consumer owns the semantics; the grid owns the geometry).

Properties

PropertyTypeDefaultDescription
(none) ——No ARIA surface: the grid is transparent layout. Disclosure semantics belong to the toggling control, not the lane.

Universal props

PropertyTypeDefaultDescription
size'small' | 'medium' | 'large' | 'auto' | number'auto' · ambient scopethe base scale — root font-size; parts size in em
shape'round' | 'scoop' | 'bevel' | 'notch' | 'square' | 'squircle' | 'auto''auto' · ambient scopecorner geometry (CSS corner-shape; §14 degrade table)
radius'small' | 'medium' | 'large' | 'auto' | number'auto' · ambient scopecorner size; auto = the concentric broadcast (§3)
density'small' | 'medium' | 'large' | 'auto' | number'auto' · ambient scopespacing/leading scale over the kernel channels (§4)
color'primary' | 'secondary' | 'error' | 'warn' | 'success' | 'info' | 'auto' | number | string'auto' · ambient scopethe hue axis of the fixed oklch primary system (§5)
theme'light' | 'dark' | 'system' | 'auto''auto' · ambient scopelight/dark profile; system = the JS-mutable global (§6)
elevation'level-1' | 'level0' | 'level1' | 'level2' | 'level3' | 'level4' | 'level5' | 'auto' | number'auto' · ambient scopeofficial M3 levels over the surface ladder (§7)
motion'reduced' | 'subtle' | 'normal' | 'expressive' | 'auto' | number'auto' · ambient scopeintensity across the motion kernels (§8)

theming

Tokens

The same single token family as stack: the --jx-space-N ladder feeds every gap rung. No paint of its own.

Properties

PropertyTypeDefaultDescription
--jx-space-2 … 80 16 rungsthe sheet ladderEvery gap atom resolves one rung — the identical ladder stack rides.

axes

Universal props

The eight-axis surface (explicit-props): size · shape · radius · density · color · theme · elevation · motion — each axis takes named steps, auto (inherit the ambient context; stamps nothing), an exact number (px · coefficient · dp · hue per axis), or query() for responsive/container-conditional values. FIRST-TIME contract, all no-own: cols/rows/gap stay STRUCTURAL props — the axes are the paint/kinetic surface a layout container forwards.

Grid · universal props

The layout primitive forwards the tree's axes to its tenants.

grid-universal.svelte svelte
<Grid size="medium">…</Grid>

api

API

Four structural props plus the HTML rest — all optional, all never-ambient (the same ruling as stack: a track count has nothing meaningful to inherit).

Properties

PropertyTypeDefaultDescription
cols 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12— (single column)Equal track count — the blowout-proof repeat(N, minmax(0, 1fr)) law.
rows 'collapse' | 'open'—The disclosure lane: collapse = the 0fr track (hidden), open = the 1fr track (full). Omitted = no named row state.
gap '2' | '4' | '6' | '8' | '10' | '12' | '14' | '16' | '18' | '20' | '24' | '28' | '32' | '40' | '48' | '80'— (none)The typed space ladder rung (token-bound; the sheet’s --jx-space-N).
children Snippet—The grid’s contents.
…rest HTMLAttributes<HTMLDivElement>spreadEvery other attribute lands on the div — consumer attributes replace, never merge.
jixoai-ui ui.jixoai.com the jixoai design language

Theme

Brand hue

0°

Auto cycle · 24h