Skip to main content

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.

Gap classes add consistent gutters between cells inside a .tg-row. Tidgrid implements gaps using the classic negative-margin technique: a negative margin-left and/or margin-top is applied to the row to cancel out the equal padding-left and/or padding-top added to each child cell. This means gaps are symmetrical and do not create unwanted outer spacing on the row’s edges.

Gap Size Scale

Six named sizes are available, ranging from no gap to a generous 2rem.
NameValueTypical use
none0Reset or explicitly remove spacing
xs0.25remTight UI elements, icon rows
sm0.5remCompact card grids
md0.75remGeneral-purpose gutters
lg1remSpacious content grids
xl2remSection-level layouts

Gap Variant Classes

Three variant families let you control gutter direction independently.
ClassSets on RowSets on Child CellsDirection
.tg-gap(*)margin-left: -size; margin-top: -sizepadding-left: size; padding-top: sizeBoth axes
.tg-x-gap(*)margin-left: -sizepadding-left: sizeHorizontal only
.tg-y-gap(*)margin-top: -sizepadding-top: sizeVertical only
Replace * with any size name: none, xs, sm, md, lg, or xl.

Examples

Both-Axis Gap

Use .tg-gap(*) to apply equal horizontal and vertical spacing between all cells.
<div class="tg-row tg-mode(auto) tg-gap(md)">
  <div class="tg-cell">Cell A</div>
  <div class="tg-cell">Cell B</div>
  <div class="tg-cell">Cell C</div>
</div>

Horizontal Gap Only

Use .tg-x-gap(*) when you want gutters between columns but no vertical spacing — for example, in single-row toolbars.
<div class="tg-row tg-mode(thin) tg-x-gap(sm)">
  <div class="tg-cell">Button</div>
  <div class="tg-cell">Button</div>
  <div class="tg-cell">Button</div>
</div>

Vertical Gap Only

Use .tg-y-gap(*) to add space between wrapped rows of cells without affecting horizontal alignment.
<div class="tg-row tg-frac(1/2) tg-y-gap(lg)">
  <div class="tg-cell">Top left</div>
  <div class="tg-cell">Top right</div>
  <div class="tg-cell">Bottom left</div>
  <div class="tg-cell">Bottom right</div>
</div>

Combining X and Y Gaps

You can mix .tg-x-gap(*) and .tg-y-gap(*) with different sizes to get asymmetric gutters.
<div class="tg-row tg-frac(1/3) tg-x-gap(xl) tg-y-gap(sm)">
  <div class="tg-cell">Wide horizontal gap</div>
  <div class="tg-cell">Tight vertical gap</div>
  <div class="tg-cell">Per axis control</div>
</div>

Resetting Gaps

Use .tg-gap(none) to explicitly zero out all gutters — useful when overriding a gap set by a responsive variant.
<div class="tg-row tg-mode(auto) tg-gap(lg) md:tg-gap(none)">
  <div class="tg-cell">No gap at md and above</div>
  <div class="tg-cell">No gap at md and above</div>
</div>
Because gap classes apply a negative margin to the row, make sure the row’s parent has overflow: hidden or sufficient padding if the negative margin would otherwise clip visible content or cause unintended scrollbars.

Responsive Usage

All three gap families fully support breakpoint prefixes. This lets you tighten or widen gutters at specific viewport sizes.
BreakpointPrefixMin-Width
Extra smallxs:36em (576px)
Smallsm:48em (768px)
Mediummd:64em (1024px)
Largelg:75em (1200px)
Extra largexl:90em (1440px)
<!-- Small gap on mobile, large gap on wider screens -->
<div class="tg-row tg-mode(auto) tg-gap(xs) md:tg-gap(lg)">
  <div class="tg-cell">Responsive gutters</div>
  <div class="tg-cell">Responsive gutters</div>
  <div class="tg-cell">Responsive gutters</div>
</div>
Breakpoint gap classes compose cleanly with breakpoint mode classes. Adjust both together to produce fully adaptive grid layouts from a single row element.

Build docs developers (and LLMs) love