Skip to content

Box shadow generator

Stack shadow layers, see them on a real card on a light or dark background, and copy the result as a Tailwind class, plain CSS or an @theme token. A box shadow is x y blur spread colour; shadows that look real use two or more soft, low-opacity layers.

Start from
Layers
Radius16px
Pro planPopular
€29/ month

Everything in Starter, plus unlimited projects, priority support and team roles.

Start free trial
shadow-[0_1px_1px_rgb(0_0_0/0.06),0_2px_4px_-1px_rgb(0_0_0/0.06),0_8px_16px_-4px_rgb(0_0_0/0.08),0_24px_48px_-12px_rgb(0_0_0/0.12)]

Tailwind CSS 4 shadows

The values behind Tailwind's own shadow classes. Click a preset in the generator to start from one.

Apart from shadow-2xs, a 1px line, all of them reach the sides too. For a soft shadow under the element only, set the spread to minus the blur, as in box shadow on the bottom only.

Classbox-shadow
shadow-2xs0 1px rgb(0 0 0 / 0.05)
shadow-xs0 1px 2px 0 rgb(0 0 0 / 0.05)
shadow-sm0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)
shadow-md0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)
shadow-lg0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)
shadow-xl0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)
shadow-2xl0 25px 50px -12px rgb(0 0 0 / 0.25)

Cards and pricing tables with the shadows already right

10 of 116 free, no account. All of them in UI Pro.

  • Link cards (content-cards-01)01

    Link cards

    content-cards-01 · Free. Four city photo tiles with an inset frame, the city name and a home count; each tile is one link.

    Open content-cards-01
  • Pricing (pricing-01)02

    Pricing

    pricing-01 · Free. Three plan cards under a monthly/yearly switch, the middle one framed with a tab, beside a photo card for schools.

    Open pricing-01
  • 03

    All free blocks

    Every one with a live preview, filtered to the ones you can use for free first.

    See them all

Questions

How do I make a box shadow in CSS?

box-shadow takes an x offset, a y offset, a blur, an optional spread and a colour: box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1). Separate several shadows with commas; the first one is drawn on top. Add inset to draw it inside the box. Shadows that look like real light are usually two or more layers: a small sharp one for the edge and a large soft one for the lift.

How do I use a custom box shadow in Tailwind CSS?

Write it as an arbitrary value with underscores for spaces: shadow-[0_4px_6px_-1px_rgb(0_0_0/0.1)]. If you use it more than once, add it to your theme instead: @theme { --shadow-card: 0 4px 6px -1px rgb(0 0 0 / 0.1); } and Tailwind makes the shadow-card class. The generator writes all three forms.

What are the Tailwind CSS shadow sizes?

Tailwind 4 has shadow-2xs, shadow-xs, shadow-sm, shadow-md, shadow-lg, shadow-xl and shadow-2xl, plus inset-shadow-2xs to inset-shadow-sm. shadow-md is 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1). In v4 the names moved down one step: v3's shadow-sm is now shadow-xs, and v3's shadow is now shadow-sm.

Why does my shadow look grey and muddy?

Usually one big black layer at high opacity. Use two or three layers with low opacity (4–12%), a negative spread on the large one so it stays under the card, and on a coloured background tint the shadow with a darker shade of that colour instead of black.

How do I change the shadow colour in Tailwind?

Add a colour class next to the size: shadow-lg shadow-blue-500/20. In Tailwind 4 the colour replaces the colour of every layer and keeps each layer's own opacity unless you set one.

Is it free?

Yes. No sign-up, and nothing leaves your browser. The link in the address bar holds your shadow, so you can share it.

UI Pro

Build your next site from finished blocks

Every block, page template and website theme from €199, paid once, with every update and everything we add later. Not ready? The free blocks are open to everyone.

blocks
1401
page templates
55
website themes
29
The About page template from UI Pro, built from its blocks.

This card is a UI Pro block: Rooilijn (call-to-action-07).