GridItem
Grid placement wrapper that serialises column, row and area props into CSS Grid shorthand.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-grid-item> — 2 parts: the root element carrying grid placement styles, and the default slot hosting the cell content.- 1.origam-grid-item
- Root element. Sets
grid-column,grid-roworgrid-areavia inline styles. Also appliesmin-width: 0; min-height: 0to prevent overflow. - 2.origam-grid-item #default
- Default slot hosting the cell content. No constraints imposed — content defines its own sizing.
API
Props
All props accepted by this component, with their type, default value and description.
- columnIGridLineSpec | string | number
- Inline-axis placement (grid-column). Accepts a line spec object { start, end, span }, a CSS string (e.g. "1 / 5"), or a number.
- rowIGridLineSpec | string | number
- Block-axis placement (grid-row). Same accepted shapes as column.
- areastring
- grid-area name. When set, overrides column and row. Use with the parent grid areas prop.
- alignSelf
- Per-item align-self override. Falls back to the parent grid alignItems when unset.
- justifySelf
- Per-item justify-self override. Falls back to the parent grid justifyItems when unset.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered at the root of the grid item.
API
Slots
Content slots exposed by this component.
- #default
- Content placed inside this grid cell.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- ComputedRef<string | undefined>
- Serialised grid-column value derived from the column prop. Readable by parent tooling.
- ComputedRef<string | undefined>
- Serialised grid-row value derived from the row prop.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Notes
- GridItem is a layout wrapper with no semantic role. Place semantic content inside the default slot. The tag prop lets you promote it to a meaningful element (e.g. tag="article").
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- dimensionvar(--origam-space---1)
- Extra-small gap token shared with parent OrigamGrid.
- dimensionvar(--origam-space---4)
- Medium gap token shared with parent OrigamGrid.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Column placement
Named area
Ecosystem
Family
Components from the same folder that share conventions and often compose together.