The peer-item grid.
Primitive contract
Grid
Arranges repeated peers with one intrinsic mode and a restrained set of explicit column modes.
Repeated peer-item composition · @sanchika/primitivesPurpose and semantics
Arranges repeated peers with one intrinsic mode and a restrained set of explicit column modes.
Recommended semantic: Use ul or ol for lists; otherwise choose section or div based on the content relationship.
Anatomy
Repeated peers with independent content.
Finite variants and important states
- Variant · columns
- auto, 2, 3
- Variant · gap
- sm, md, lg
- Required states
- default
- Class hooks
.sk-grid · .sk-grid-columns-auto · .sk-grid-columns-2 · .sk-grid-columns-3 · .sk-grid-gap-sm · .sk-grid-gap-md · .sk-grid-gap-lg
Composed synthetic exemplar
Rendered state matrix
Grid: 1 required state
Each specimen starts from the package-owned example and contract state inventory. Simulated pointer and focus frames are labelled; consumers still verify real interaction in context.
- …
Accessibility and consumer responsibility
- Grid must not change focus order.
- Retain list semantics for repeated list items.
- Choose semantic list markup when applicable
- Keep item order meaningful
- Explicit columns collapse to one
- Intrinsic mode never forces horizontal overflow
No override is needed because the primitive adds no motion.
- Grid adds no authored color or boundary.
Compact API reference
- Package
@sanchika/primitives- CSS
@sanchika/primitives/styles.css- Contract
primitiveSpecs.find((contract) => contract.name === "Grid")- Primary class
.sk-grid