Layout
Utility classes for setting how many columns an element splits into.
| Class | Styles |
|---|---|
| columns-<number> | columns: <number>; |
| columns-3xs | columns: var(--container-3xs); /* 16rem (256px) */ |
| columns-2xs | columns: var(--container-2xs); /* 18rem (288px) */ |
| columns-xs | columns: var(--container-xs); /* 20rem (320px) */ |
| columns-sm | columns: var(--container-sm); /* 24rem (384px) */ |
| columns-md | columns: var(--container-md); /* 28rem (448px) */ |
| columns-lg | columns: var(--container-lg); /* 32rem (512px) */ |
| columns-xl | columns: var(--container-xl); /* 36rem (576px) */ |
| columns-2xl | columns: var(--container-2xl); /* 42rem (672px) */ |
| columns-3xl | columns: var(--container-3xl); /* 48rem (768px) */ |
| columns-4xl | columns: var(--container-4xl); /* 56rem (896px) */ |
| columns-5xl | columns: var(--container-5xl); /* 64rem (1024px) */ |
| columns-6xl | columns: var(--container-6xl); /* 72rem (1152px) */ |
| columns-7xl | columns: var(--container-7xl); /* 80rem (1280px) */ |
| columns-auto | columns: auto; |
| columns-(<custom-property>) | columns: var(<custom-property>); |
| columns-[<value>] | columns: <value>; |
Reach for columns-<number> utilities such as columns-3 to control how many columns should be generated for the content inside an element:









<div class="columns-3 ..."> <img class="aspect-3/2 ..." src="/img/mountains-1.jpg" /> <img class="aspect-square ..." src="/img/mountains-2.jpg" /> <img class="aspect-square ..." src="/img/mountains-3.jpg" /> <!-- ... --></div>The column widths are calculated for you automatically to fit the number you asked for.
Reach for utilities such as columns-xs and columns-sm to define the ideal column width for content inside an element:
Drag the example wider or narrower to see it respond




<div class="columns-3xs ..."> <img class="aspect-3/2 ..." src="/img/mountains-1.jpg" /> <img class="aspect-square ..." src="/img/mountains-2.jpg" /> <img class="aspect-square ..." src="/img/mountains-3.jpg" /> <!-- ... --></div>When you fix the column width, the number of columns adapts on its own so none of them ever become too narrow.
Reach for the gap-<width> utilities to define the spacing between columns:









<div class="columns-3 gap-8 ..."> <img class="aspect-3/2 ..." src="/img/mountains-1.jpg" /> <img class="aspect-square ..." src="/img/mountains-2.jpg" /> <img class="aspect-square ..." src="/img/mountains-3.jpg" /> <!-- ... --></div>Dig deeper into the gap utilities over in the gap reference guide.
Reach for the columns-[<value>] syntax when you need to set the columns from a fully custom value:
<div class="columns-[30vw] ..."> <!-- ... --></div>For CSS variables, you can also reach for the columns-(<custom-property>) syntax:
<div class="columns-(--my-columns) ..."> <!-- ... --></div>This is just a shorthand for columns-[var(<custom-property>)] that adds the var() function on your behalf automatically.
Add a breakpoint variant such as sm: in front of a columns utility to apply it only at small screen sizes and above:
Drag the example to a new size to see how it responds









<div class="columns-2 gap-4 sm:columns-3 sm:gap-8 ..."> <img class="aspect-3/2 ..." src="/img/mountains-1.jpg" /> <img class="aspect-square ..." src="/img/mountains-2.jpg" /> <img class="aspect-square ..." src="/img/mountains-3.jpg" /> <!-- ... --></div>Read more about using variants in the variants reference guide.
Reach for the --container-* theme variables to tailor the fixed-width column utilities across your project:
@theme { --container-4xs: 14rem; }Now the columns-4xs utility is ready to use in your markup:
<div class="columns-4xs"> <!-- ... --></div>Discover how to shape your theme design in the theme documentation.

5-day crash course
Ship UIs you'll be proud of.
Bite-sized, practical video lessons from the makers of Breezel, delivered right to your inbox every single day for a whole week.