Tidgrid gives you two complementary approaches to controlling how wide each cell is. Fractions are the simplest path — snap a cell to one-half, one-third, one-quarter, or two-thirds of the row in a single class. Spans unlock a full column grid where you declare explicit column counts, giving you the fine-grained control of a traditional 12- or 16-column layout without any external grid framework.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sneikki/tidgrid/llms.txt
Use this file to discover all available pages before exploring further.
Fractional Sizing with tg-frac
Fractions set a cell’s flex-basis to a fixed percentage. You can apply tg-frac either on the .tg-row (which sets that width for all child cells) or on an individual .tg-cell (which overrides the width for that cell only).
Available fractions:
| Class | Cell width |
|---|---|
tg-frac(1/2) | 50% |
tg-frac(1/3) | 33.333…% |
tg-frac(1/4) | 25% |
tg-frac(2/3) | 66.666…% |
Row-level fractions
Applyingtg-frac on the row sets every direct .tg-cell child to that width. Cells that exceed the row width wrap naturally thanks to flex-wrap: wrap.
html
html
Cell-level fractions
Applytg-frac directly on .tg-cell to size that cell independently from its siblings.
html
Span-Based Sizing
The span system gives you a traditional column grid. Wrap your layout in a.tg-size(12) or .tg-size(16) container, then use tg-span(N) on rows or cells to declare how many columns they should occupy.
Setting up the grid context
The.tg-size(N) class is a context wrapper — it activates the column system for everything inside it. The class itself applies no visual styles; it simply enables tg-span classes with the correct column math.
html
The 12-column grid
Inside.tg-size(12), tg-span(N) sets cell width to (N / 12) × 100%. Use it on the row to set all cells to the same span, or on individual cells for mixed-width layouts.
The 16-column grid
The 16-column grid works identically, but with.tg-size(16) and tg-span(N) values from 1 to 16. Each column unit is 6.25% of the row width.
html
tg-span(3) out of 16 ≈ 18.75%) or precise 1/16 increments for design-system grids.
html
Fractions vs. Spans
Use tg-frac when…
- You need simple halves, thirds, quarters, or two-thirds
- You want the smallest possible amount of markup
- The layout doesn’t require a precise column count
- You’re building content-driven layouts like card grids or split panels
Use tg-span when…
- You need precise column widths that don’t fit 1/2, 1/3, 1/4, or 2/3
- You’re implementing a design system with a defined column grid
- You need mixed-width rows where cells span different column counts
- You want 16-column precision for finer layout increments
Responsive Spans and Fractions
Bothtg-frac and tg-span support all five responsive breakpoint prefixes. Stack multiple breakpoint classes to build layouts that reflow at each screen size.
html
html
tg-frac(1/1) does not exist. The available fractions are 1/2, 1/3, 1/4, and 2/3 only. For full-width cells, rely on the default stacked behaviour (no frac class needed) or apply tg-mode(stacked) explicitly.