Skip to content

TMS Grid

TMSGrid arranges repeated content in a responsive flex grid. The columns prop sets the widest layout, then the grid steps down at smaller breakpoints before stacking.

Usage

One
Two
Three
html
<TMSGrid
  columns="3">
  <!-- box-count="auto" -->
  <TMSBox type="title">One</TMSBox>
  <TMSBox type="title">Two</TMSBox>
  <TMSBox type="title">Three</TMSBox>
</TMSGrid>

Props

PropTypeDefaultNotes
columns1 | 2 | ... 61Sets the maximum column count on the widest breakpoint.

Slots

SlotNotes
defaultGrid content.

INFO

The examples use TMSBox to make the column behavior visible. TMSGrid can wrap any slotted content; each child owns its own visual treatment.

Variables

TMSGrid exposes layout and density variables that child components can opt into:

VariablePurpose
--tms-grid-gapGap between grid children.
--tms-grid-item-font-sizeSuggested text size for grid-aware children.
--tms-grid-item-line-heightSuggested line height for grid-aware text.

TMSBox uses these variables when it is rendered inside TMSGrid, while preserving its standalone defaults outside a grid.

scss
.my-grid-item {
  font-size: var(--tms-grid-item-font-size, 1.25rem);
  line-height: var(--tms-grid-item-line-height, 1.1);
}