component

Grid

A modular field grid

props · 43 shown · 43 total

Container

Layout

  • "start" "center"
    default "center"

    Horizontal placement of the container within its parent.

  • Responsive<RasterSpace | GridMargin>
    default 1

    Page margins, in lines (preferred) or spacing tokens. A bare value sets all four sides.

  • "2xl" "3xl" "4xl" "5xl" "6xl" "7xl" "8xl" "breakpoint-2xl" "breakpoint-lg" "breakpoint-md" "breakpoint-sm" "breakpoint-xl" "control.lg" "control.md" "control.sm" "control.xl" "control.xs" "fit" "full" "lg" "max" "md" "min" "prose" "raster.line" "sm" "xl" "xs"
    default "breakpoint-2xl"

    Largest width the type area may reach.

  • "recto" "verso"
    default "recto"

    Facing-page side. Swaps which physical edge `inside`/`outside` land on.

Advanced

  • "div" "main" "section" "article" "aside" "header" "footer" "nav" "ul" "ol" "li"
    default "div"

    Element to render.

  • string

    Extra classes merged after the component's own, so a consumer rule wins.

  • { root?: SlotPassThrough }

    Per-slot overrides: `style` is a Panda style object merged into the slot's classes, `props` are extra HTML attributes spread onto it.

Grid

Layout

  • "start" "center"
    default "start"

    Horizontal placement of the grid BOX within its parent — the grid's own margin, not its children's. Contrast `alignItems`.

  • "start" "center" "end" "stretch"

    Block alignment of every field within its row span, set once on the grid. Unset, CSS Grid's own `stretch` applies and nothing changes; a single field overrides it with its own `alignSelf`.

  • boolean
    default false

    Quantise a field's height to whole lines when its content overflows. Client-side only and deliberately opt-in — it trades layout stability for rhythm. See `observeRasterOverflow`.

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>
    default 6

    Columns across the type area.

  • "auto" "lines" "fields"
    default "auto"

    Row track generation. `"auto"` gives content-height rows with a one-line floor — the only mode that works for auto-placed content. `"lines"` makes every track exactly one line, for deliberate field placement; `"fields"` makes auto-placement land on field boundaries.

  • Responsive<RasterSpace>
    default 1

    Gutter between cells, in lines (preferred) or a spacing token. Applies to both axes — in the exact row modes the vertical gutter is one line track, so a matching horizontal gutter makes the raster isotropic.

  • "2xl" "3xl" "4xl" "5xl" "6xl" "7xl" "8xl" "breakpoint-2xl" "breakpoint-lg" "breakpoint-md" "breakpoint-sm" "breakpoint-xl" "control.lg" "control.md" "control.sm" "control.xl" "control.xs" "fit" "full" "lg" "max" "md" "min" "prose" "raster.line" "sm" "xl" "xs" "reset"

    The baseline step. Omit to INHERIT the surrounding rhythm — which is what a nested grid almost always wants. `"reset"` re-pins it to the token.

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>
    default 5

    Field height in text LINES — the `k` in `height(S) = (S·k + S − 1)` lines.

  • Responsive<RasterSpace | GridMargin>

    Page margins around the raster, in lines (preferred) or spacing tokens. Usually left to a parent `Container`. A bare value sets all four sides.

  • "2xl" "3xl" "4xl" "5xl" "6xl" "7xl" "8xl" "breakpoint-2xl" "breakpoint-lg" "breakpoint-md" "breakpoint-sm" "breakpoint-xl" "control.lg" "control.md" "control.sm" "control.xl" "control.xs" "fit" "full" "lg" "max" "md" "min" "prose" "raster.line" "sm" "xl" "xs"

    Largest width the grid may reach. Usually left to a parent `Container`, which owns the type area; set it only on a standalone grid.

  • "recto" "verso"
    default "recto"

    Facing-page side. Swaps which physical edge `inside`/`outside` land on.

  • boolean
    default false

    Apply the baseline rhythm scope to the subtree (`data-rhythm`).

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>

    Fixed canvas height in FIELDS. Omit for a content-height grid.

Slots

  • children slot svelte
    Snippet

    The grid's fields — normally `<GridItem>` elements, plus an optional `<GridGuides>`.

Advanced

  • "div" "main" "section" "article" "aside" "header" "footer" "nav" "ul" "ol" "li"
    default "div"

    Element to render.

  • string

    Extra classes merged after the component's own, so a consumer rule wins.

  • element binding svelte
    Element null

    Bound reference to the root element (`bind:this`). Typed loosely as `Element` to stay compatible with `svelte:element`.

  • { root?: SlotPassThrough }

    Per-slot overrides: `style` is a Panda style object merged into the slot's classes, `props` are extra HTML attributes spread onto it.

GridItem

Layout

  • "start" "center" "end" "stretch"

    The field's own block alignment within its row span. Overrides the grid's `alignItems`. Unset, the item follows the grid's `alignItems` (and CSS Grid's own `stretch` when that is unset too).

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>

    1-based column the field starts at. Omit to auto-place.

  • number "full" Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number | "full">>
    default 1

    Columns to span. `"full"` spans the whole type area (`1 / -1`).

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>

    Escape hatch: place by LINE track instead of by field, within `flow="lines"`. Wins over `row`/`rowSpan`. Use it when a composition is designed against the baseline itself rather than against fields — a masthead, a poster, a cover. Field placement cannot express "start on line 7", because a field row always begins a whole field-plus-gutter into the grid.

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>
    default 1

    Line tracks to span, paired with `line`.

  • "auto" "visible" "clip" "scroll"
    default "visible"

    What happens when content is taller than the span. CSS cannot round an intrinsic size, so `"visible"` keeps the raster exact and lets the overflow show — the only option with no layout shift. `"scroll"` reserves the scrollbar gutter unconditionally, `"auto"` only when it overflows.

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>

    1-based FIELD row the item starts at. Omit to auto-place.

  • number Partial<Record<"2xl" | "lg" | "md" | "sm" | "xl" | "base", number>>
    default 1

    FIELD rows to span — not line tracks. The connect converts.

Advanced

  • "div" "main" "section" "article" "aside" "header" "footer" "nav" "ul" "ol" "li"
    default "div"

    Element to render.

  • string

    Extra classes merged after the component's own, so a consumer rule wins.

  • { root?: SlotPassThrough }

    Per-slot overrides: `style` is a Panda style object merged into the slot's classes, `props` are extra HTML attributes spread onto it.

GridGuides

Appearance

  • "lines" "fields" "both"
    default "both"

    Which layers to draw: the column/baseline rules, the field bands, or both.

  • string

    Colour of the field/column bands.

  • string

    Colour of the 1px rules.

  • string
    default "1px"

    Thickness of the rules.

Advanced

  • "div" "main" "section" "article" "aside" "header" "footer" "nav" "ul" "ol" "li"
    default "div"

    Element to render.

  • string

    Extra classes merged after the component's own, so a consumer rule wins.

  • { root?: SlotPassThrough }

    Per-slot overrides: `style` is a Panda style object merged into the slot's classes, `props` are extra HTML attributes spread onto it.

Type

  • Components
  • Blocks