1. Layout
  2. columns

Layout

columns

Utility classes for setting how many columns an element splits into.

ClassStyles
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) */

Examples

Setting by count

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.

Sizing by width

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.

Tuning the column gap

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.

Passing a custom value

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.

Responsive layouts

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.

Tailoring your theme

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.

Ship interfaces you love — 5-day mini-course

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.

Start the free course

Copyright © 2026 Breezel, Inc.·Brand Guidelines