Every layout utility in Tidgrid has a responsive variant for each of its five breakpoints. You unlock them with a single prefix: write the breakpoint name followed by a colon before anyDocumentation 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.
tg- class, and that class activates only when the viewport reaches the corresponding minimum width. Combine a base class for mobile behavior with one or more prefixed overrides for larger screens, and you get a fully adaptive layout in pure HTML.
How the Prefix Works
The syntax is{breakpoint}:tg-{utility}({value}). For example:
48em (768px). At 48em and above, it switches the row into auto-width mode. In CSS, Tidgrid renders it as:
: in the class name is valid HTML — no special treatment needed.
Responsive classes are generated entirely at build time. There is no JavaScript involved. Breakpoint switching is handled by the browser’s native CSS media query engine.
Supported Utilities
All of the following utility families have full responsive variants across all five breakpoints (xs, sm, md, lg, xl):
| Utility | What It Controls | Example |
|---|---|---|
tg-mode | Row/cell flex behavior | md:tg-mode(auto) |
tg-flow | Wrapping behavior | sm:tg-flow(keep) |
tg-frac | Equal-fraction column widths | md:tg-frac(1/3) |
tg-span | Column widths by grid span | lg:tg-span(4) |
tg-gap | Horizontal + vertical spacing | md:tg-gap(lg) |
tg-x-gap | Horizontal spacing only | sm:tg-x-gap(md) |
tg-y-gap | Vertical spacing only | sm:tg-y-gap(xs) |
tg-pos | Justify + align (both axes) | lg:tg-pos(center) |
tg-pos-x | Justify content (horizontal) | md:tg-pos-x(end) |
tg-pos-y | Align items (vertical) | md:tg-pos-y(start) |
tg-space | Space distribution (both axes) | lg:tg-space(between) |
tg-space-x | Horizontal space distribution | xl:tg-space-x(around) |
tg-space-y | Vertical space distribution | xl:tg-space-y(evenly) |
Practical Examples
Stack on Mobile, Side-by-Side on Tablet
The most common responsive pattern: a single column on small screens, a multi-column row on tablet and up. Applytg-mode(stacked) as the base, then override with sm:tg-mode(auto) to flip to flexible columns at the sm breakpoint.
- Mobile (< 768px)
- Tablet+ (≥ 768px)
tg-mode(stacked) is active. Each .tg-cell takes width: 100% and stacks vertically.Small Gap on Mobile, Larger Gap on Desktop
Scale spacing as the viewport grows. Start compact on mobile withtg-gap(xs) and expand to a generous gap on desktop with md:tg-gap(lg).
- Mobile (< 1024px)
- Desktop (≥ 1024px)
tg-gap(xs) applies 0.25rem padding on each cell and a matching negative margin on the row.Center on Mobile, Space-Between on Desktop
Adjust alignment and distribution to suit different screen contexts. Center items on narrow viewports, then spread them to full width on large screens.- Mobile / Tablet (< 1200px)
- Large Desktop (≥ 1200px)
tg-pos(center) sets justify-content: center and align-items: center. Items cluster in the middle.Different Cell Fractions at Different Breakpoints
Control individual cell widths per breakpoint by placing responsivetg-frac classes directly on .tg-cell elements. This lets a sidebar shrink or expand as space allows.
- Mobile / Tablet (< 1024px)
- Desktop (≥ 1024px)
Both cells use
tg-frac(1/2) — a 50/50 split. The sidebar and content share the row equally.Combining Multiple Breakpoint Prefixes
You can stack as many prefixed classes as you need on a single element. Each one is independent — the browser applies whichevermin-width condition is satisfied at the current viewport size.
xs first, xl last), so larger breakpoints always override smaller ones correctly.
How It Looks Under the Hood
Responsive classes are plain CSS class selectors with escaped colons. When Tidgrid builds its CSS,variant.generate iterates over every breakpoint and emits a copy of each utility rule inside a min-width media query:
tidgrid.css — the browser does nothing more than evaluate standard CSS media queries at render time.