<div class="ts-grid">
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
</div>
A grid has 16 columns per row. Columns without a set width adjust to content.
This example uses columns of 2, 8, and 6 widths, 2 + 8 + 6 = 16
; and that fills a row.
<div class="ts-grid">
<div class="column is-2-wide"></div>
<div class="column is-8-wide"></div>
<div class="column is-6-wide"></div>
</div>
Columns wrap to the next row if their total width exceeds 16 columns.
This example uses columns of 5, 6, and 8 widths, and 5 + 6 + 8 = 19
; so the extra column wraps to the next row.
<div class="ts-grid">
<div class="column is-5-wide"></div>
<div class="column is-6-wide"></div>
<div class="column is-8-wide"></div>
</div>
A grid can have different columns per row with is-1-columns
to is-10-columns
.
<div class="ts-grid is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
<div class="ts-grid is-6-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
A grid can auto-resize columns to split width evenly: 2 columns at 50%, 3 columns at 33%, etc.
<div class="ts-grid is-evenly-divided">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
Grids can be placed inside of other grids, letting you sub-divide columns.
<div class="ts-grid is-2-columns">
<div class="column">
<div class="ts-grid is-4-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
</div>
<div class="column"></div>
</div>
A column can take the width of the remaining space.
<div class="ts-grid">
<div class="column is-4-wide"></div>
<div class="column is-fluid"></div>
<div class="column is-4-wide"></div>
</div>
A column can be moved to the first or last.
<div class="ts-grid">
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
<div class="column is-8-wide is-first"></div>
</div>
<div class="ts-grid">
<div class="column is-8-wide is-last"></div>
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
</div>
A column can be reordered with is-order-1
to is-order-10
. All columns must have a set order. Ideal for reordering on mobile with Responsive.
<div class="ts-grid">
<div class="column is-2-wide is-order-4"></div>
<div class="column is-3-wide is-order-3"></div>
<div class="column is-4-wide is-order-2"></div>
<div class="column is-7-wide is-order-1"></div>
</div>
A grid can have its columns aligned at the start, center, or end.
<div class="ts-grid is-start-aligned">
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
</div>
<div class="ts-grid is-center-aligned">
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
</div>
<div class="ts-grid is-end-aligned">
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
</div>
A grid can have its columns aligned at the top, middle, or bottom.
<div class="ts-grid is-top-aligned is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
<div class="ts-grid is-middle-aligned is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
<div class="ts-grid is-bottom-aligned is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
A grid can stretch its first-level elements or a Box to match the height of other columns.
This card contains a line of text.
This card contains two lines of text.
This card contains two lines of text.
This card contains three lines of text.
This card contains three lines of text.
All cards have the same height.
<div class="ts-grid is-stretched is-3-columns">
<div class="column">
<div class="ts-box">
<div class="ts-content">
<p>This card contains a line of text.</p>
</div>
</div>
</div>
<div class="column">
<div class="ts-box">
<div class="ts-content">
<p>This card contains two lines of text.</p>
<p>This card contains two lines of text.</p>
</div>
</div>
</div>
<div class="column">
<div class="ts-box">
<div class="ts-content">
<p>This card contains three lines of text.</p>
<p>This card contains three lines of text.</p>
<p>All cards have the same height.</p>
</div>
</div>
</div>
</div>
A grid can have dividers between columns, but only in a single-row grid.
<div class="ts-grid is-divided is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
A grid can have spaces between or around its columns.
<div class="ts-grid is-spaced-between">
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
</div>
<div class="ts-grid is-spaced-around">
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
<div class="column is-3-wide"></div>
</div>
A grid can specify that its columns should reverse order, works well with Responsive.
<div class="ts-grid is-reversed">
<div class="column is-2-wide"></div>
<div class="column is-4-wide"></div>
<div class="column is-10-wide"></div>
</div>
A stacked grid will automatically stack rows into a single column, ideal for mobile devices with Responsive.
<div class="ts-grid is-stacked">
<div class="column is-2-wide"></div>
<div class="column is-3-wide"></div>
<div class="column is-4-wide"></div>
</div>
A grid can adjust the gap between columns.
<div class="ts-grid is-relaxed is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
<div class="ts-grid is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
<div class="ts-grid is-compact is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
Everything works well with Responsive in Tocas UI. The following example is a basic guide.
Column width can vary by device; e.g., tablet+:is-8-wide
displays as 8 columns wide on tablets or larger.
<div class="ts-grid">
<div class="column mobile:is-16-wide tablet+:is-8-wide"></div>
<div class="column mobile:is-16-wide tablet+:is-8-wide"></div>
<div class="column mobile:is-16-wide tablet+:is-8-wide"></div>
<div class="column mobile:is-16-wide tablet+:is-8-wide"></div>
</div>
Applying is-stacked
on mobile devices stacks rows into a single column (sets all columns to 16 columns wide).
<div class="ts-grid mobile:is-stacked">
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
<div class="column is-4-wide"></div>
</div>
Change column number by device; e.g., mobile:is-2-columns
for 2 columns on mobile, and tablet+:is-3-columns
for 3 columns on tablets or larger.
<div class="ts-grid mobile:is-2-columns tablet+:is-3-columns">
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
<div class="column"></div>
</div>
Columns can appear or be hidden on specific devices or screen sizes. See Responsive for details.
<div class="ts-grid">
<div class="column mobile:has-hidden is-4-wide"></div>
<div class="column tablet+:has-hidden is-4-wide"></div>
<div class="column desktop-:has-hidden is-4-wide"></div>
<div class="column widescreen:has-hidden is-4-wide"></div>
</div>
Search bars usually have flexible and fixed columns. Columns without a set width adjust to their content.
Description | Default Value | Target | |
---|---|---|---|
--gap |
The width of the gap between columns. |
1rem |
.ts-grid |