Tailwind CSS
Box Shadow Generator

Generate box shadow for your Tailwind CSS project with this interactive tool. You can copy the generated CSS code with a single click.

Item Name

This card element can be used to display a product, post, or any other type of data.

shadow-[0px_10px_15px_-3px_rgba(0,_0,_0,_0.1)]
0px50px
10px50px
15px100px
-3px50px
0.1

Ready made Tailwind CSS Box Shadows

Here are ready-made Tailwind CSS box shadows that you can use in your projects.

shadow-sm v4: shadow-xs
shadow
shadow-md
shadow-lg
shadow-xl
shadow-2xl
shadow-inner
shadow-none
Pricing
Free
Categories
Design
Listed
May 2023
Updated
Oct 2026
KEY POINTS
  • Web app
  • Code export
  • Tailwind CSS v4
  • Tailwind CSS v3

Short verdict: Tailwind Box Shadow Generator is a free tool on this page that turns five sliders, an inset switch and a color into one Tailwind class, shadow-[...], ready to paste. The class renders the same shadow in Tailwind CSS v3 and v4, and eight preset tiles show Tailwind's built-in shadows for comparison. It makes one shadow layer at a time, so soft, realistic shadows that stack two or three layers still need hand editing. Our first test found five problems, the worst being that the copied class lost the inset keyword; we fixed them the same day. Use it to dial in a single custom shadow; use a palette tool if you want a full elevation scale.

How we reviewed it: On 30 October 2026 we used the generator on this page with a mouse at 1,440 px and with touch input at 390 px. We moved every slider, switched inset on and off, typed valid, short and broken hex colors, used Randomize and every preset, reloaded the page and read the clipboard after each copy. We rendered the copied classes and all eight presets with Tailwind CSS 3.4.17 and 4.1.13 and compared the computed shadows, and ran Lighthouse 12.8.2 before and after our fixes. Because the tool is ours, we also read its source and fixed what we found, then repeated the tests.

Disclosure: Tailkits makes this tool. We review it with the same tests we use for other makers' products and list its problems the same way.

What you get for free

PriceFree, no account, runs in your browser on this page
ControlsHorizontal and vertical offset (-50 to 50 px), blur (0 to 100 px), spread (-50 to 50 px), an inset switch, a color picker or hex field, opacity (0 to 1 in steps of 0.05) and a Randomize button
OutputOne arbitrary-value class, for example shadow-[0px_10px_15px_-3px_rgba(0,_0,_0,_0.1)], with inset_ in front when inset is on
Presets8 Tailwind classes, from shadow-sm to shadow-2xl, shadow-inner and shadow-none, each with a copy button
Tailwind versionsThe generated class rendered the same in Tailwind CSS 3.4.17 and 4.1.13. One preset name differs in v4 (below).
Not includedMore than one shadow layer, plain CSS output, rgb or hsl input, saving a shadow

What we found

One shadow in, one class out

Every slider updates the preview card and the class at once, and the Copy button put exactly the shown class on our clipboard. We pasted the default class into a page with each Tailwind version: both computed the same 0px 10px 15px -3px shadow at 10% black that the preview draws. The color is always written as rgba() from the hex value and the opacity slider, so the class doesn't follow your theme colors. Randomize picks small offsets, a blur of 5 to 20 px and a random color, and always turns inset off. Nothing is kept on reload.

Five problems we found and fixed

Our first pass turned up five problems. Because Tailkits makes the tool, we fixed them the same day and repeated the tests on the fixed page:

  • Inset was lost. With inset on, the preview showed an inner shadow, but the copied class had no inset, so your page got an outer shadow. The class now starts with inset_, which both Tailwind versions render.

  • Broken colors in the class. The hex field passed half-typed values on, so #12 produced rgba(18,_NaN,_NaN,_0.1). The color now changes only when the field holds a valid #rgb or #rrggbb value, and #abc expands to #aabbcc.

  • Unlabeled controls. The four sliders, the color picker, the hex field and the opacity slider had no accessible names, and the inset switch didn't report its state. They do now.

  • No copy feedback on phones. Tapping a preset copied its class, but the overlay that says "Copied!" only appeared on hover, so phones showed nothing. It now stays visible for two seconds after a copy.

  • Class cut off on phones. At 390 px the class ended in an ellipsis. It now wraps onto more lines.

Two copies of the generator with inset on at 0.6 opacity: before the fix the class reads shadow-[0px_10px_15px_-3px_rgba(0,_0,_0,_0.6)] without inset; after the fix it reads shadow-[inset_0px_10px_15px_-3px_rgba(0,_0,_0,_0.6)]
Same settings, inset on: the class before the fix (left) dropped inset; after the fix (right) it keeps it.

The presets use Tailwind v3 names

We rendered all eight preset classes in both versions. Seven gave the same shadow. shadow-sm did not: Tailwind v4 renamed v3's shadow-sm to shadow-xs, and v4's shadow-sm is v3's shadow. The tiles are drawn with this site's Tailwind v3 styles, so on a v4 project copy shadow-xs for the look of the first tile. The tile now says so.

Eight preset tiles from shadow-sm to shadow-none, with a note under shadow-sm reading v4: shadow-xs
The preset tiles, with the v4 name noted on shadow-sm.

One layer only

Tailwind's own shadow-md and shadow-lg stack two shadows, and soft, realistic shadows usually stack two or three. The generator makes one. You can join layers yourself with a comma inside the brackets, for example shadow-[0px_1px_2px_0px_rgba(0,_0,_0,_0.1),0px_8px_16px_-4px_rgba(0,_0,_0,_0.2)], which rendered both layers in Tailwind CSS 3.4.17 and 4.1.13.

Performance and accessibility

Lighthouse 12.8.2, 30 October, before our fixesPerformanceAccessibilityBest practicesSEO
Mobile728975100
Desktop1009374100

On a simulated phone, 445 KiB of the page's 663 KiB transfer is third-party analytics, and total blocking time was 1,770 ms; the generator itself sends nothing. The accessibility audit flagged the unlabeled controls. After the fix, a re-run gave 93 on mobile and 97 on desktop, and the remaining failures are low-contrast text and small tap targets elsewhere on the page.

What the class leaves to you

  • States and themes: add hover:, focus: or dark: in front of the class, or a second class for dark mode, because a black shadow disappears on a dark background.

  • Reuse: to use one shadow in many places, move the value into your theme (a --shadow-* variable in v4, theme.extend.boxShadow in v3) instead of repeating a long class.

  • Extra layers, joined by hand as shown above.

Pros and cons

Pros

  • Free and instant, with a live preview on a realistic card.

  • The copied class rendered the same in Tailwind v3 and v4.

  • Presets let you compare a custom shadow with Tailwind's built-in scale.

  • Works with a mouse or touch, and every control has a label.

Cons

  • One layer per shadow; stacked shadows need hand editing.

  • Colors are written as rgba, not theme colors, and only hex input is accepted.

  • No plain CSS output and nothing saved on reload.

  • Preset tiles show v3 shadows, so shadow-sm looks different on a v4 project.

How Tailwind Box Shadow Generator compares

  • HTML-CSS-JS Box Shadow Generator (free) adds several layers with "Add new" and has a gallery of effects, but writes plain CSS, not Tailwind classes. Choose it for multi-layer shadows you then convert.

  • Shadow Palette Generator by Josh W. Comeau (free) builds low, medium and high elevations from several layers each, with a shadow color matched to your background, as CSS custom properties. Choose it when you want a consistent shadow scale for a whole design system.

  • Tailwind Text Shadow Generator (free) is the companion tool on Tailkits for shadows on text rather than boxes.

More Tailwind generators and design tools are in UI design tools.

Who should use Tailwind Box Shadow Generator

Use it when one element needs a shadow that Tailwind's built-in scale doesn't have: a tinted glow, a pressed inset field, a long soft drop. Copy the class and add states by hand. If you are defining shadows for a whole product, build a layered scale with a palette tool and keep it in your theme instead.

FAQ

Is the Tailwind Box Shadow Generator free?

Yes. It is free, needs no account and runs in your browser on this page.

Does the class work with Tailwind CSS v3 and v4?

Yes. The generated shadow-[...] class rendered the same shadow in Tailwind CSS 3.4.17 and 4.1.13 in our test, including inset shadows.

Why does shadow-sm look different in my Tailwind v4 project?

Tailwind v4 renamed the scale: v3's shadow-sm is shadow-xs in v4, and v4's shadow-sm matches v3's shadow. The preset tiles on this page show the v3 shadows.

Can I make a shadow with more than one layer?

Not in the tool, which makes one layer. Join layers yourself with a comma inside the brackets, for example shadow-[0px_1px_2px_0px_rgba(0,_0,_0,_0.1),0px_8px_16px_-4px_rgba(0,_0,_0,_0.2)], which works in v3 and v4.

Can I copy plain CSS instead of a Tailwind class?

No. The tool copies a Tailwind class only. The values inside the brackets are the CSS box-shadow value with underscores for spaces, so replace the underscores with spaces to use them in a stylesheet.

Do you make Tailwind Box Shadow Generator? Get a badge for your site

An optional "Featured on Tailkits" badge that links to this page. Pick light or dark and paste the code into your site, for example in the footer.

Featured on Tailkits
Featured on Tailkits