30 Tailwind CSS Grid Layouts
17 / 30

All 30 in 30 Tailwind CSS Grid Layouts

  1. 01Tailwind Full-Bleed Article Layout for Long-Form Editorial
  2. 02Tailwind Docs Layout with Sticky Table of Contents
  3. 03Tailwind Photo Gallery Grid with auto-fill and Real Images
  4. 04Tailwind Holy Grail Page Layout for a News Site
  5. 05Tailwind Data Table with Subgrid Rows and Status Pills
  6. 06Tailwind Overlapping Card Hero for a Case Study
  7. 07Tailwind Help Center Layout with Fixed Sidebars
  8. 08Tailwind 12 Column Grid System for Marketing Pages
  9. 09Tailwind Bento Grid for a Product Feature Section
  10. 10Tailwind Magazine Spread Layout with Overlapping Headline
  11. 11Tailwind Responsive Card Grid for an Integrations Directory
  12. 12Tailwind CMS Category Grid that Compacts Itself with has()
  13. 13Tailwind Masonry Layout for a Saved Ideas Board
  14. 14Tailwind Hexagon Team Grid with clip-path Avatars
  15. 15Tailwind Subgrid Cards with Perfectly Aligned Buttons
  16. 16Tailwind Analytics Dashboard Layout with Grid App Shell
  17. 17Tailwind Pricing Table with Subgrid and a Featured Plan
  18. 18Tailwind Kanban Board with Scroll Snap Columns
  19. 19Tailwind Video Thumbnail Grid with Zero Layout Shift
  20. 20Tailwind Container Query Card for Reusable Article Teasers
  21. 21Tailwind Diagonal Section Band with skewY Counter-Skew
  22. 22Tailwind Asymmetric Poster Hero with Layered Grid Regions
  23. 23Tailwind Mosaic Photo Wall with a Designed Span Sequence
  24. 24Tailwind Dense Grid Packing for a Mixed-Size Asset Library
  25. 25Tailwind Onboarding Stepper with CSS Counters
  26. 26Tailwind macOS Window Layout with Vibrancy Sidebar
  27. 27Tailwind Scroll Snap Carousel with Peeking Slides
  28. 28Tailwind Status Map UI with Grid Coordinate Pins
  29. 29Tailwind Logo Wall with 1px Gap Hairline Dividers
  30. 30Tailwind Periodic Table Layout with Grid Coordinates
Pure TailwindMIT licensed

Tailwind Pricing Table with Subgrid and a Featured Plan

Three plans with genuinely different feature counts, and CTAs that still land on one line. The featured plan lifts with scale-105 — a transform, so its tracks stay locked to its siblings — and prices sit in <data> with tabular figures.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<section class="tgx-17 w-full min-h-svh bg-[linear-gradient(180deg,oklch(0.97_0.01_300),oklch(0.93_0.02_295))] font-tgx17-sans px-6 py-10">
  <header class="flex flex-col items-center gap-2 text-center mb-8">
    <p class="text-[0.66rem] tracking-[0.18em] uppercase text-tgx17-violet">Relay · Pricing</p>
    <h2 class="text-[1.6rem] font-semibold text-tgx17-ink tracking-[-0.015em]">Pay for seats, not for uptime</h2>
    <p class="text-[0.86rem] leading-[1.6] text-tgx17-mut max-w-[46ch]">Every plan includes unlimited incidents, full history and the API. Annual billing saves two months.</p>
  </header>
  <div class="grid grid-cols-[repeat(auto-fit,minmax(min(200px,100%),1fr))] auto-rows-auto gap-5 w-[min(760px,100%)] mx-auto">
    <article class="row-span-5 [grid-template-rows:subgrid] grid gap-y-3.5 rounded-[18px] border border-tgx17-edge bg-white p-6">
      <p class="text-[0.62rem] tracking-[0.14em] uppercase font-bold text-tgx17-violet">&nbsp;</p>
      <div class="flex flex-col gap-1"><h3 class="text-[1.1rem] font-semibold text-tgx17-ink">Hobby</h3><p class="text-[0.76rem] text-tgx17-mut">For a side project and one pager.</p></div>
      <p class="flex items-baseline gap-1"><data value="9" class="text-[2.2rem] font-extrabold tabular-nums tracking-[-0.02em] text-tgx17-ink">$9</data><span class="text-[0.8rem] text-tgx17-mut">/mo</span></p>
      <ul class="list-disc list-inside marker:text-tgx17-violet flex flex-col gap-2 content-start text-[0.8rem] leading-[1.5] text-tgx17-mut"><li>3 services</li><li>Community support</li><li>7-day history</li></ul>
      <a href="#0" class="self-end grid items-center text-center min-h-11 px-4 rounded-full text-[0.85rem] font-semibold no-underline text-tgx17-violet border-[1.5px] border-tgx17-violet transition-colors hover:bg-tgx17-violettint focus-visible:outline-2 focus-visible:outline-tgx17-violet focus-visible:outline-offset-[3px]">Start free</a>
    </article>
    <article class="row-span-5 [grid-template-rows:subgrid] grid gap-y-3.5 rounded-[18px] border border-tgx17-violet bg-white p-6 scale-105 z-10 shadow-[0_24px_48px_-24px_color-mix(in_oklab,var(--color-tgx17-violet)_50%,transparent)]">
      <p class="text-[0.62rem] tracking-[0.14em] uppercase font-bold text-tgx17-violet">Most popular</p>
      <div class="flex flex-col gap-1"><h3 class="text-[1.1rem] font-semibold text-tgx17-ink">Pro</h3><p class="text-[0.76rem] text-tgx17-mut">For a team that ships on Fridays.</p></div>
      <p class="flex items-baseline gap-1"><data value="29" class="text-[2.2rem] font-extrabold tabular-nums tracking-[-0.02em] text-tgx17-ink">$29</data><span class="text-[0.8rem] text-tgx17-mut">/seat/mo</span></p>
      <ul class="list-disc list-inside marker:text-tgx17-violet flex flex-col gap-2 content-start text-[0.8rem] leading-[1.5] text-tgx17-mut"><li>Unlimited services</li><li>On-call rotations</li><li>90-day history</li><li>Slack &amp; PagerDuty</li><li>Priority support</li></ul>
      <a href="#0" class="self-end grid items-center text-center min-h-11 px-4 rounded-full text-[0.85rem] font-semibold no-underline text-white bg-tgx17-violet transition-colors hover:bg-tgx17-violetdark focus-visible:outline-2 focus-visible:outline-tgx17-violet focus-visible:outline-offset-[3px]">Start 14-day trial</a>
    </article>
    <article class="row-span-5 [grid-template-rows:subgrid] grid gap-y-3.5 rounded-[18px] border border-tgx17-edge bg-white p-6">
      <p class="text-[0.62rem] tracking-[0.14em] uppercase font-bold text-tgx17-violet">&nbsp;</p>
      <div class="flex flex-col gap-1"><h3 class="text-[1.1rem] font-semibold text-tgx17-ink">Enterprise</h3><p class="text-[0.76rem] text-tgx17-mut">For regulated and multi-region teams.</p></div>
      <p class="flex items-baseline gap-1"><data value="99" class="text-[2.2rem] font-extrabold tabular-nums tracking-[-0.02em] text-tgx17-ink">$99</data><span class="text-[0.8rem] text-tgx17-mut">/seat/mo</span></p>
      <ul class="list-disc list-inside marker:text-tgx17-violet flex flex-col gap-2 content-start text-[0.8rem] leading-[1.5] text-tgx17-mut"><li>Everything in Pro</li><li>SSO &amp; audit log</li><li>Data residency</li><li>99.9% SLA</li></ul>
      <a href="#0" class="self-end grid items-center text-center min-h-11 px-4 rounded-full text-[0.85rem] font-semibold no-underline text-tgx17-violet border-[1.5px] border-tgx17-violet transition-colors hover:bg-tgx17-violettint focus-visible:outline-2 focus-visible:outline-tgx17-violet focus-visible:outline-offset-[3px]">Contact sales</a>
    </article>
  </div>
</section>
@import "tailwindcss";

@theme {
  --color-tgx17-violet: #5b35c4;
  --color-tgx17-violet: oklch(0.45 0.21 295);
  --color-tgx17-violetdark: #47259f;
  --color-tgx17-violetdark: oklch(0.38 0.2 295);
  --color-tgx17-violettint: #f0eafc;
  --color-tgx17-violettint: oklch(0.95 0.02 295);
  --color-tgx17-edge: #ddd6ef;
  --color-tgx17-edge: oklch(0.88 0.03 295);
  --color-tgx17-ink: #241d3b;
  --color-tgx17-ink: oklch(0.25 0.04 295);
  --color-tgx17-mut: #56506b;
  --color-tgx17-mut: oklch(0.45 0.03 295);
  --font-tgx17-sans: 'Inter Tight', system-ui, sans-serif;
}

.tgx-17 {
  width: 100%;
  min-height: 100svh;
}

@supports not (grid-template-rows: subgrid) {
  .tgx-17 article {
    grid-template-rows: auto auto auto 1fr auto;
  }
}

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

Compiles in the browser — perfect for a CodePen or a quick test, not for production.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-tgx17-violet: #5b35c4;
  --color-tgx17-violet: oklch(0.45 0.21 295);
  --color-tgx17-violetdark: #47259f;
  --color-tgx17-violetdark: oklch(0.38 0.2 295);
  --color-tgx17-violettint: #f0eafc;
  --color-tgx17-violettint: oklch(0.95 0.02 295);
  --color-tgx17-edge: #ddd6ef;
  --color-tgx17-edge: oklch(0.88 0.03 295);
  --color-tgx17-ink: #241d3b;
  --color-tgx17-ink: oklch(0.25 0.04 295);
  --color-tgx17-mut: #56506b;
  --color-tgx17-mut: oklch(0.45 0.03 295);
  --font-tgx17-sans: 'Inter Tight', system-ui, sans-serif;
}

.tgx-17 {
  width: 100%;
  min-height: 100svh;
}

@supports not (grid-template-rows: subgrid) {
  .tgx-17 article {
    grid-template-rows: auto auto auto 1fr auto;
  }
}
3Fonts used by this demooptional — skip if you have your own type stack
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;800&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • The plan name row now holds a name AND a one-line audience — a second element inside one subgrid track, which is allowed and useful: the track grows once, for every card.
  • Per-seat versus flat pricing is spelled out in the suffix, the kind of detail that makes a pricing demo copy-pasteable.
  • Product upgrade: added a section header, audience lines and real plan names with a trial CTA; the alignment problem is now the one a real pricing page has, with a 3/5/4-bullet spread.
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Pricing Table with Subgrid and a Featured Plan
Source: https://codefronts.com/layouts/tailwind-css-grid-layouts/tailwind-pricing-table-subgrid-featured-plan/

Three plans with genuinely different feature counts, and CTAs that still land on one line. The featured plan lifts with scale-105 — a transform, so its tracks stay locked to its siblings — and prices sit in <data> with tabular figures.
## HTML
```html
<section class="tgx-17 w-full min-h-svh bg-[linear-gradient(180deg,oklch(0.97_0.01_300),oklch(0.93_0.02_295))] font-tgx17-sans px-6 py-10">
  <header class="flex flex-col items-center gap-2 text-center mb-8">
    <p class="text-[0.66rem] tracking-[0.18em] uppercase text-tgx17-violet">Relay · Pricing</p>
    <h2 class="text-[1.6rem] font-semibold text-tgx17-ink tracking-[-0.015em]">Pay for seats, not for uptime</h2>
    <p class="text-[0.86rem] leading-[1.6] text-tgx17-mut max-w-[46ch]">Every plan includes unlimited incidents, full history and the API. Annual billing saves two months.</p>
  </header>
  <div class="grid grid-cols-[repeat(auto-fit,minmax(min(200px,100%),1fr))] auto-rows-auto gap-5 w-[min(760px,100%)] mx-auto">
    <article class="row-span-5 [grid-template-rows:subgrid] grid gap-y-3.5 rounded-[18px] border border-tgx17-edge bg-white p-6">
      <p class="text-[0.62rem] tracking-[0.14em] uppercase font-bold text-tgx17-violet">&nbsp;</p>
      <div class="flex flex-col gap-1"><h3 class="text-[1.1rem] font-semibold text-tgx17-ink">Hobby</h3><p class="text-[0.76rem] text-tgx17-mut">For a side project and one pager.</p></div>
      <p class="flex items-baseline gap-1"><data value="9" class="text-[2.2rem] font-extrabold tabular-nums tracking-[-0.02em] text-tgx17-ink">$9</data><span class="text-[0.8rem] text-tgx17-mut">/mo</span></p>
      <ul class="list-disc list-inside marker:text-tgx17-violet flex flex-col gap-2 content-start text-[0.8rem] leading-[1.5] text-tgx17-mut"><li>3 services</li><li>Community support</li><li>7-day history</li></ul>
      <a href="#0" class="self-end grid items-center text-center min-h-11 px-4 rounded-full text-[0.85rem] font-semibold no-underline text-tgx17-violet border-[1.5px] border-tgx17-violet transition-colors hover:bg-tgx17-violettint focus-visible:outline-2 focus-visible:outline-tgx17-violet focus-visible:outline-offset-[3px]">Start free</a>
    </article>
    <article class="row-span-5 [grid-template-rows:subgrid] grid gap-y-3.5 rounded-[18px] border border-tgx17-violet bg-white p-6 scale-105 z-10 shadow-[0_24px_48px_-24px_color-mix(in_oklab,var(--color-tgx17-violet)_50%,transparent)]">
      <p class="text-[0.62rem] tracking-[0.14em] uppercase font-bold text-tgx17-violet">Most popular</p>
      <div class="flex flex-col gap-1"><h3 class="text-[1.1rem] font-semibold text-tgx17-ink">Pro</h3><p class="text-[0.76rem] text-tgx17-mut">For a team that ships on Fridays.</p></div>
      <p class="flex items-baseline gap-1"><data value="29" class="text-[2.2rem] font-extrabold tabular-nums tracking-[-0.02em] text-tgx17-ink">$29</data><span class="text-[0.8rem] text-tgx17-mut">/seat/mo</span></p>
      <ul class="list-disc list-inside marker:text-tgx17-violet flex flex-col gap-2 content-start text-[0.8rem] leading-[1.5] text-tgx17-mut"><li>Unlimited services</li><li>On-call rotations</li><li>90-day history</li><li>Slack &amp; PagerDuty</li><li>Priority support</li></ul>
      <a href="#0" class="self-end grid items-center text-center min-h-11 px-4 rounded-full text-[0.85rem] font-semibold no-underline text-white bg-tgx17-violet transition-colors hover:bg-tgx17-violetdark focus-visible:outline-2 focus-visible:outline-tgx17-violet focus-visible:outline-offset-[3px]">Start 14-day trial</a>
    </article>
    <article class="row-span-5 [grid-template-rows:subgrid] grid gap-y-3.5 rounded-[18px] border border-tgx17-edge bg-white p-6">
      <p class="text-[0.62rem] tracking-[0.14em] uppercase font-bold text-tgx17-violet">&nbsp;</p>
      <div class="flex flex-col gap-1"><h3 class="text-[1.1rem] font-semibold text-tgx17-ink">Enterprise</h3><p class="text-[0.76rem] text-tgx17-mut">For regulated and multi-region teams.</p></div>
      <p class="flex items-baseline gap-1"><data value="99" class="text-[2.2rem] font-extrabold tabular-nums tracking-[-0.02em] text-tgx17-ink">$99</data><span class="text-[0.8rem] text-tgx17-mut">/seat/mo</span></p>
      <ul class="list-disc list-inside marker:text-tgx17-violet flex flex-col gap-2 content-start text-[0.8rem] leading-[1.5] text-tgx17-mut"><li>Everything in Pro</li><li>SSO &amp; audit log</li><li>Data residency</li><li>99.9% SLA</li></ul>
      <a href="#0" class="self-end grid items-center text-center min-h-11 px-4 rounded-full text-[0.85rem] font-semibold no-underline text-tgx17-violet border-[1.5px] border-tgx17-violet transition-colors hover:bg-tgx17-violettint focus-visible:outline-2 focus-visible:outline-tgx17-violet focus-visible:outline-offset-[3px]">Contact sales</a>
    </article>
  </div>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tgx17-violet: #5b35c4;
  --color-tgx17-violet: oklch(0.45 0.21 295);
  --color-tgx17-violetdark: #47259f;
  --color-tgx17-violetdark: oklch(0.38 0.2 295);
  --color-tgx17-violettint: #f0eafc;
  --color-tgx17-violettint: oklch(0.95 0.02 295);
  --color-tgx17-edge: #ddd6ef;
  --color-tgx17-edge: oklch(0.88 0.03 295);
  --color-tgx17-ink: #241d3b;
  --color-tgx17-ink: oklch(0.25 0.04 295);
  --color-tgx17-mut: #56506b;
  --color-tgx17-mut: oklch(0.45 0.03 295);
  --font-tgx17-sans: 'Inter Tight', system-ui, sans-serif;
}

.tgx-17 {
  width: 100%;
  min-height: 100svh;
}

@supports not (grid-template-rows: subgrid) {
  .tgx-17 article {
    grid-template-rows: auto auto auto 1fr auto;
  }
}
```

How this works

The features track is sized by the longest list, so a five-bullet plan and a three-bullet plan share the same footprint and both buttons sit on the shared final row.

The lift is a transform on purpose. Padding or margin would change the geometry and pull the row out of alignment; scale-105 only paints larger.

Make it yours

  • Annual/monthly toggle: swap the <data> values — the grid never moves.
  • Add a tier: one more <article>, and auto-fit absorbs it.
  • De-emphasise the free tier with border contrast, never with smaller type.

Gotchas — read before shipping

  • The scale lift needs z-10 or neighbouring borders overlap it at the sides.
  • Never clamp feature lists to equal length to fake alignment — subgrid exists so they can differ.
  • Keep CTAs at 44px; pricing CTAs are the most-tapped element on a SaaS site.

Browser support

ChromeSafariFirefoxEdge
117+16+128+117+

subgrid-gated, with the same @supports fallback as demo 15.

Techniques used in this demo

Search CodeFronts

Loading…