Columns
Columns and Column components for laying content side by side.
<Columns> puts blocks of content side by side. It is the plain layout
container: unlike <CardGroup>, it draws nothing of its
own — no border, no padding, no background — so whatever you put in a column
looks exactly as it would in the body of the page.
Basic Usage
Before
Requests were signed with a shared secret.
After
Requests are signed with a per-key HMAC.
Props
Columns
| Prop | Type | Default | Description |
|---|---|---|---|
cols | 1 | 2 | 3 | 4 | 2 | Number of columns |
Column
<Column> takes no props. It is a container for whatever you write inside it.
Column Counts
cols is honoured exactly — the number you write is the number of tracks you
get, and the tracks are equal width.
Free — 1 project
Team — 10 projects
Enterprise — unlimited
This is the one place <Columns> and <CardGroup> differ in behaviour rather
than in appearance. A CardGroup with no cols fits as many cards as will fit
at a 16rem minimum. A Column has no natural minimum width — it holds whatever
you put in it — so fitting tracks to content would mean the layout changed
every time someone edited a paragraph. <Columns> with no cols is always
two.
On Narrow Screens
Below 40rem — phones, and the mobile drawer — every cols value collapses to a
single column and the content stacks in source order. Two columns of prose on a
phone is worse than one.
A tablet in portrait keeps its tracks, so a cols={2} layout reads as two
columns at 768px just as a CardGroup does at the same width.
What Goes In a Column
Anything the page body accepts: prose, lists, images, code fences, callouts, even another component.
A callout works inside a column.
Two things to keep in mind:
Printing
The tracks are kept on paper. A printed page is wider than the content column of a screen, so a two-column comparison prints as a two-column comparison. The gap is tightened slightly, because paper has no scrollbar to allow for.
When to Use Something Else
<CardGroup>. Cards
carry a title, an icon and a click target; columns carry none of that.<Tabs> or <CodeGroup>. A
reader picks one; they do not read both.<Steps>.