GridItem
Grid placement wrapper that serialises column, row and area props into CSS Grid shorthand.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #default
- Content placed inside this grid cell.
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
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").
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- dimensionvar(--origam-space---1)
- Extra-small gap token shared with parent OrigamGrid.
- dimensionvar(--origam-space---4)
- Medium gap token shared with parent OrigamGrid.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Column placement
Named area
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.