SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/tailwind-card-grids

6 Tailwind Card Grids

6 TailwindPublished 2026-10-05Free · no sign-up

Six ways to lay out cards: an auto-fit blog grid, a two-column feature grid, a team grid, a shop grid with add buttons, masonry-style columns and a sideways snap-scrolling row.

01. Tailwind Blog Card Grid

TailwindCardsBlog

Article cards in an auto-fit grid that goes from one to three columns on its own. Each whole card is a link with one clear heading, and the image placeholder keeps a fixed aspect ratio so rows line up.

View code
<ul class="grid w-full max-w-sm grid-cols-[repeat(auto-fit,minmax(9rem,1fr))] gap-3">
  <li><a href="#post1" class="block overflow-hidden rounded-xl bg-white ring-1 ring-slate-200 hover:shadow-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"><div aria-hidden="true" class="aspect-video bg-gradient-to-br from-amber-300 to-rose-400"></div><div class="p-3"><p class="text-xs text-slate-600">Guides</p><h3 class="text-sm font-bold text-slate-900">Write product pages people finish</h3></div></a></li>
  <li><a href="#post2" class="block overflow-hidden rounded-xl bg-white ring-1 ring-slate-200 hover:shadow-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"><div aria-hidden="true" class="aspect-video bg-gradient-to-br from-sky-300 to-indigo-400"></div><div class="p-3"><p class="text-xs text-slate-600">News</p><h3 class="text-sm font-bold text-slate-900">What changed in checkout this month</h3></div></a></li>
</ul>

02. Tailwind Feature Card Grid

TailwindCardsFeatures

Four feature cards in a two-column grid, each with an icon tile, a short title and one line of copy. The icons are decorative and the titles carry the meaning.

View code
<ul class="grid w-full max-w-xs grid-cols-2 gap-3">
  <li class="rounded-xl bg-slate-800 p-3"><span aria-hidden="true" class="grid size-8 place-items-center rounded-lg bg-indigo-500/20 text-indigo-300">⚡</span><h3 class="mt-2 text-sm font-bold text-white">Fast</h3><p class="text-xs text-slate-300">Pages load in under a second.</p></li>
  <li class="rounded-xl bg-slate-800 p-3"><span aria-hidden="true" class="grid size-8 place-items-center rounded-lg bg-emerald-500/20 text-emerald-300">🔒</span><h3 class="mt-2 text-sm font-bold text-white">Secure</h3><p class="text-xs text-slate-300">Encrypted from end to end.</p></li>
  <li class="rounded-xl bg-slate-800 p-3"><span aria-hidden="true" class="grid size-8 place-items-center rounded-lg bg-amber-500/20 text-amber-300">🧩</span><h3 class="mt-2 text-sm font-bold text-white">Modular</h3><p class="text-xs text-slate-300">Use only the parts you need.</p></li>
  <li class="rounded-xl bg-slate-800 p-3"><span aria-hidden="true" class="grid size-8 place-items-center rounded-lg bg-rose-500/20 text-rose-300">💬</span><h3 class="mt-2 text-sm font-bold text-white">Supported</h3><p class="text-xs text-slate-300">Real people answer email.</p></li>
</ul>

03. Tailwind Team Member Grid

TailwindCardsTeam

A team grid with initials avatars, names and roles, centred in each card. The grid uses grid-cols-3 with small cards, and long names truncate rather than break the layout.

View code
<ul class="grid w-full max-w-xs grid-cols-3 gap-2 text-center">
  <li class="rounded-xl bg-white p-3 ring-1 ring-slate-200"><span aria-hidden="true" class="mx-auto grid size-12 place-items-center rounded-full bg-violet-700 text-sm font-bold text-white">RK</span><h3 class="mt-2 truncate text-sm font-bold text-slate-900">Rhea K.</h3><p class="truncate text-xs text-slate-600">Design</p></li>
  <li class="rounded-xl bg-white p-3 ring-1 ring-slate-200"><span aria-hidden="true" class="mx-auto grid size-12 place-items-center rounded-full bg-teal-700 text-sm font-bold text-white">DT</span><h3 class="mt-2 truncate text-sm font-bold text-slate-900">Dev T.</h3><p class="truncate text-xs text-slate-600">Engineering</p></li>
  <li class="rounded-xl bg-white p-3 ring-1 ring-slate-200"><span aria-hidden="true" class="mx-auto grid size-12 place-items-center rounded-full bg-orange-700 text-sm font-bold text-white">MS</span><h3 class="mt-2 truncate text-sm font-bold text-slate-900">Mo S.</h3><p class="truncate text-xs text-slate-600">Support</p></li>
</ul>

04. Tailwind Product Card Grid

TailwindCardsShop

A two-column shop grid with image, name, price and a small add button per product. The add buttons carry the product name in hidden text, so a list of identical Add buttons still makes sense to screen readers.

View code
<ul class="grid w-full max-w-xs grid-cols-2 gap-3">
  <li class="rounded-xl bg-white p-2 ring-1 ring-slate-200"><div role="img" aria-label="Olive linen shirt" class="aspect-square rounded-lg bg-gradient-to-b from-lime-200 to-lime-600"></div><h3 class="mt-2 text-sm font-semibold text-slate-900">Linen shirt</h3><div class="mt-1 flex items-center justify-between"><p class="text-sm text-slate-700">$58</p><button type="button" class="rounded-md bg-slate-900 px-2 py-1 text-xs font-semibold text-white hover:bg-slate-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-900">Add<span class="sr-only"> linen shirt to cart</span></button></div></li>
  <li class="rounded-xl bg-white p-2 ring-1 ring-slate-200"><div role="img" aria-label="Rust wool scarf" class="aspect-square rounded-lg bg-gradient-to-b from-orange-200 to-orange-700"></div><h3 class="mt-2 text-sm font-semibold text-slate-900">Wool scarf</h3><div class="mt-1 flex items-center justify-between"><p class="text-sm text-slate-700">$34</p><button type="button" class="rounded-md bg-slate-900 px-2 py-1 text-xs font-semibold text-white hover:bg-slate-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-900">Add<span class="sr-only"> wool scarf to cart</span></button></div></li>
</ul>

05. Tailwind Masonry-Style Card Columns

TailwindCardsMasonry

Cards of different heights flowing into two columns with columns-2, the simplest masonry. break-inside-avoid stops a card being split between columns, and mb- spacing replaces the gap a grid would give.

View code
<div class="w-full max-w-xs columns-2 gap-3">
  <article class="mb-3 break-inside-avoid rounded-xl bg-amber-100 p-3 text-sm text-amber-950"><h3 class="font-bold">Short note</h3><p>Buy oat milk.</p></article>
  <article class="mb-3 break-inside-avoid rounded-xl bg-sky-100 p-3 text-sm text-sky-950"><h3 class="font-bold">Trip ideas</h3><p>Lisbon in spring, Tromsø in winter, Kyoto for the gardens in autumn.</p></article>
  <article class="mb-3 break-inside-avoid rounded-xl bg-emerald-100 p-3 text-sm text-emerald-950"><h3 class="font-bold">Books</h3><p>Finish the one on the nightstand first.</p></article>
  <article class="mb-3 break-inside-avoid rounded-xl bg-rose-100 p-3 text-sm text-rose-950"><h3 class="font-bold">Gift list</h3><p>Plant for Sam, scarf for Jo.</p></article>
</div>

06. Tailwind Horizontal Snap Card Row

TailwindCardsScroll snap

A row of cards that scrolls sideways and snaps each card into place, a common pattern on phones. snap-x snap-mandatory on the row and snap-start on cards do it, and the row is a focusable, labelled region for keyboard scrolling.

View code
<div role="region" aria-label="Recommended" tabindex="0" class="flex w-full max-w-xs snap-x snap-mandatory gap-3 overflow-x-auto pb-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
  <article class="w-40 shrink-0 snap-start rounded-xl bg-indigo-700 p-4 text-white"><h3 class="font-bold">Starter kit</h3><p class="text-sm text-indigo-100">Everything for day one.</p></article>
  <article class="w-40 shrink-0 snap-start rounded-xl bg-violet-700 p-4 text-white"><h3 class="font-bold">Pro tools</h3><p class="text-sm text-violet-100">For busy teams.</p></article>
  <article class="w-40 shrink-0 snap-start rounded-xl bg-fuchsia-700 p-4 text-white"><h3 class="font-bold">Add-ons</h3><p class="text-sm text-fuchsia-100">Extra power when needed.</p></article>
</div>

About these Tailwind Card Grids

Let the grid choose

grid-cols-[repeat(auto-fit,minmax(9rem,1fr))] gives one column on phones and more on wider screens without breakpoints.

Equal media heights

Give card images a fixed aspect-video or aspect-square so rows line up even with different pictures.

Masonry with columns

columns-2 with break-inside-avoid is the simplest masonry; order runs down each column.

Unique button names

Repeated Add buttons get hidden text with the product name, so each one is distinct to assistive technology.

Frequently asked questions

Should the whole card be a link?

When a card has one destination, yes; when it has several actions, link the title only.

Does the scroll row work with keyboard?

Yes, the row is a focusable region that scrolls with the arrow keys.

Is there a CSS version?

Yes, see the CSS card grids collection.