Sajid

UI Cards

The Easy Way to Fix Messy UIs. Every rule from the video, with the real numbers, so you can break each one and fix it yourself.

TOGGLE

What a Card Is

Three headings, each followed by a perk and a price. The fonts and hierarchy are fine, but you still have to think to match each price to its room. Add a box, and each room becomes one thing, grouped together. That's all a card is.

Room in Asheville

Guest favorite

$91 a night

Home in Aspen

Mountain view

$780 a night

Room in Moab

Free breakfast

$99 a night

TOGGLE

Rule 1: Fix the Layout First

A box can make anything look organized. The left one is a list of labels, all the same size with the same gap, so the box isn't fixing anything. Turn the box off, and only the right one still reads as a card.

Room in Asheville, NC Price: $91 per night Rating: 4.8 Beds: 1 king Cancellation: free Book now

Room in Asheville, NC

$91 a night

★ 4.8

1 king bed

Book now

Free cancellation

If a card needs its box to hold together, fix the layout first.

CLICK

Rule 2: The Strongest Card

On a room page, the booking form is the actual card, because it's the only thing there you actually use. The host's box just has a thin border to separate it from the rest. The form gets a lighter shade and a shadow, so it pops out.

Room in Asheville, NC

1 king bed · Wi-Fi · Self check-in

V

Hosted by Valentine

Superhost · 6 years hosting

A quiet room 10 minutes from downtown. The neighbor's rooster is included at no extra cost.

$91 a night

CHECK-INDec 12 CHECKOUTDec 14
Reserve

You won't be charged yet

Use the strongest card for the most interactive element.

SLIDER

Outer Radius Is a Brand Choice

Bigger cards don't get bigger corners. Vercel uses 6px on most cards, Stripe's wide card uses 8, and Apple's small tile uses 28. Sharper looks more serious and rounder looks friendlier, so pick the one that fits your product.

Payments

$12,480.00 this week

A warm bedroom in Asheville.

Room in Asheville

.card {
  border-radius: 12px;
}

SLIDER

Inner Radius

Put a card inside a card with the same radius on both, and you get a weird gap at the corners. Each corner is part of a circle, and these two circles have different centers. For an even gap they need the same center, so the inner radius is the outer radius minus the padding.

That formula breaks when the padding is bigger than the radius: 12 minus 24 is minus 12, and you get square corners. So use the formula for small gaps, and 8 or 12 when the gap is big. max() does both, because it picks whichever number is bigger.

A warm bedroom in Asheville.

Room in Asheville

$91 a night

.card {
  border-radius: 24px;
  padding: 12px;
}
.card img {
  /* 12px right now */
  border-radius: max(8px, calc(24px - 12px));
}

SLIDER

Rule 3: Radius and Padding Go Together

A big corner cuts into the space your content sits in. Push the radius up with small padding, and the content pokes out of the corner, so it needs more padding.

Room in Asheville

A quiet room 10 minutes from downtown.

$91 a night

corner-shape gives you smoother corners, like Apple's app icons. Chrome and Edge have it, and other browsers just show normal corners, so nothing breaks.

.card {
  border-radius: 64px;
  padding: 12px;
  corner-shape: squircle;
}

Pick radius and padding together, and start with padding at least as big as the radius.

TOGGLE

Padding That Looks Equal

All four sides of this card have 24px of padding, but the top looks bigger than the sides. Every line of text sits in a box taller than its letters, and that extra line height gets added on top of your padding. One line of CSS trims the line down to the letters.

Room in Asheville

$91 a night, before taxes and the rooster.

Browsers without it keep the normal spacing, so nothing breaks.

.card {
  padding: 24px;
  text-box: trim-both cap alphabetic;
}

TOGGLE

Rule 4: Answer the Worry

Right before a click, users get nervous. Am I paying the second I press this button? So answer it right there, under the button. It only costs one line of text.

Room in Asheville

$91 a night

Reserve

You won't be charged yet

Find what users are worried about, and answer it right beside the button.

SCROLL

The Form Follows You

Scroll the page inside this box. The booking card stays on screen, so the moment you decide to book, the button is right there. That's one line of CSS, plus one more if the card sits in a grid.

A warm bedroom in Asheville.

Room in Asheville, NC

1 king bed · Wi-Fi · Self check-in

About this place

A quiet room 10 minutes from downtown. The bed is a king, the Wi-Fi is fast, and the coffee is free.

The neighbor's rooster starts at 5:30 a.m. He's not ours, but he's very reliable.

What this place offers

  • Free parking on the street
  • Coffee maker
  • Washer and dryer
  • A desk that's actually a desk
  • A rooster (not ours)

House rules

Check-in after 3 p.m. Checkout before 11 a.m. Don't feed the rooster.

$91 a night

Reserve

You won't be charged yet

.booking {
  position: sticky;
  top: 24px;
  align-self: start; /* in a grid, so it doesn't stretch */
}

CLICK

Rule 5: Would They Still Click?

A lot of us design a card by taking the whole page and shrinking it. All of it is useful, but nobody reads it while comparing six other rooms. Click a field to cut it if people would still click the card without it, then hide what you cut.

11 fields left
A warm bedroom in Asheville.

For every field on your card, ask if someone would still click without it.

TOGGLE

Box or No Box

Put a box around these cards, and the photo gets smaller. So take the padding off the photo and only keep it on the text. Go a step further and remove the box completely, and you get more room for the text. It still feels like a card, because the image already has its own edge. That's how YouTube does it.

A warm bedroom in Asheville. Guest favorite

Room in Asheville

★ 4.8

$91 for 1 night

A log cabin in the Smoky Mountains.

Cabin in Gatlinburg

★ 4.95

$124 for 1 night

A small wooden garage. VC favorite

Garage in Palo Alto

★ 5.0

$1,999 for 1 night

TOGGLE

Real Content Breaks Cards

Real listings show up with no photo yet, no ratings, and photos brighter than your icons. Break this card, then turn on the fixes. And when there are no ratings, just tell the truth: it's a new listing.

A warm bedroom in Asheville. A snowy mountain town.

Room in Asheville

★ 4.8★ 0.0New

$91 for 1 night

.photo {
  aspect-ratio: 4 / 3;  /* holds the space before the photo loads */
  background: #333;     /* the placeholder */
}
.bookmark {
  fill: rgb(0 0 0 / .5); /* a dark fill and a white edge work */
  stroke: white;         /* on the brightest and darkest photos */
}

CLICK

Make the Whole Card Clickable

You want the whole card to be clickable, but you can't put a button inside a link. So the button goes on top of the card, and the link stretches over the rest of it. Click anywhere on the card, then click the bookmark.

Nothing clicked yet
A log cabin in the Smoky Mountains.

Cabin in Gatlinburg

$124 for 1 night

.card {
  position: relative;
}
.card a::after {
  content: "";
  position: absolute;
  inset: 0; /* the link covers the whole card */
}
.card button {
  position: relative;
  z-index: 1; /* the button sits on top of it */
}

TOGGLE

Double the Gap Between Rows

In a grid like this, the gap between rows needs to be bigger than the gap between columns, or each title looks like it belongs to the photo under it. I usually put exactly double. Same as YouTube.

Room in Asheville

$91 for 1 night

Cabin in Gatlinburg

$124 for 1 night

Garage in Palo Alto

$1,999 for 1 night

Home in Aspen

$780 for 1 night

Tent in Moab

$99 for 1 night

Room in Las Vegas

$69 for 1 night

.grid {
  column-gap: 16px;
  row-gap: 32px;
}

SLIDER

Rule 6: A Card Won't Fix It for You

Most of you are designing SaaS stuff like this one. Emphasize the one thing users want to know, and add more context to that number. Then put the rest in a column layout, add a line to show progress, and polish it with depth and nice round corners. The before was also a card, just without hierarchy.

Acme Analytics

Nov 2026

Revenue: $48,250 (up 12.4% vs last month)

REVENUE
$48,250 ▲ 12.4%vs last month
MRR$4,100
CHURN1.2%
LTV$980
Updated 2 hours ago View report

A card won't magically upgrade your design. But it adds a lot if you know what you're doing.

TOGGLE

Rule 7: Cards or Rows

Please find the cheapest flight. Now switch to rows and find it again. We compare things in a column much faster, even though it might not look pretty. YouTube uses a grid when you're browsing and rows when you search, and Spotify does both on one page: you pick an album by its cover and a song by its name.

Bluebird

6:05 AM to 2:40 PMNonstop$212

Redwood Air

7:30 AM to 4:55 PM1 stop$189

Northbound

9:15 AM to 5:50 PMNonstop$247

Pelican

11:40 AM to 11:05 PM2 stops (one is Ohio)$176

Skyward

1:20 PM to 9:45 PMNonstop$203

Arcadia Air

6:50 PM to 3:15 AMRed-eye$181

Picking with your eyes, use cards. Comparing numbers or reading names, use rows.

TOGGLE

Pricing Cards

Look at these cards. You have to read all three prices one by one, then the headings, then the features. Show one filled button, give it a colored border, and add a lighter shade, and the decision is half made before anyone reads a word.

But real content isn't perfect. When one plan gets a longer description, the prices and buttons stop lining up. The usual fix is margin-top: auto, but the features sit under the button, so that can't help. Subgrid makes all three cards share the same rows.

Senior

For when prod is your problem now, plus the pager, the postmortem, and a standing 9 a.m. with legal

$9/month

Select
  • Unlimited deploys
  • One-click rollback
  • Deploys on Fridays
  • Someone else to blame

Mid-level

Reads the docs, sometimes

$99/month

Select
  • Unlimited deploys
  • One-click rollback
  • Custom domains

Junior

Works on your machine

$69/month

Select
  • Unlimited deploys
  • Preview links
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.plan {
  display: grid;
  grid-row: span 5; /* one row per part of the card */
  grid-template-rows: subgrid;
}

TOGGLE

Mixed Sizes

On this blog, all four cards are the same size, so where do you even start? Make one bigger, and it changes everything. It's screaming at you to read it first. Bigger cards can also change their layout, based on how much room they get.

8 MIN READ

How we built multi-region support for Nova

We moved Nova to three regions. Now it goes down in three time zones.

12 MIN READ

Rethinking the startup MVP: what if it just worked

6 MIN READ

A design reset (part I of 69)

5 MIN READ

Why we stopped asking people to invert a binary tree

Nobody here has inverted one at work. We checked.

.post-slot {
  container-type: inline-size;
}
@container (min-width: 480px) {
  .post {
    grid-template-columns: 1fr 1fr; /* photo beside the text */
  }
}

All 7 Rules

  1. If a card needs its box to hold together, fix the layout first.
  2. Use the strongest card for the most interactive element.
  3. Pick radius and padding together, and start with padding at least as big as the radius.
  4. Find what users are worried about, and answer it right beside the button.
  5. For every field on your card, ask if someone would still click without it.
  6. A card won't magically upgrade your design. But it adds a lot if you know what you're doing.
  7. Picking with your eyes, use cards. Comparing numbers or reading names, use rows.

Photos from Wikimedia Commons: Todtanis (CC BY-SA 3.0), David Ratledge (CC BY 4.0), Oysterboy9 (CC BY-SA 4.0), Wolfgang Moroder (CC BY-SA 3.0), mypubliclands (public domain), Torsade de Pointes (CC0), and Deror avi (CC BY-SA 3.0).