1. Effects
  2. box-shadow

Effects

box-shadow

Helpers for shaping the box shadow drawn around any element.

ClassStyles
shadow-2xs
box-shadow: var(--shadow-2xs); /* 0 1px rgb(0 0 0 / 0.05) */
shadow-xs
box-shadow: var(--shadow-xs); /* 0 1px 2px 0 rgb(0 0 0 / 0.05) */
shadow-sm
box-shadow: var(--shadow-sm); /* 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) */
shadow-md
box-shadow: var(--shadow-md); /* 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) */
shadow-lg
box-shadow: var(--shadow-lg); /* 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) */
shadow-xl
box-shadow: var(--shadow-xl); /* 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) */
shadow-2xl
box-shadow: var(--shadow-2xl); /* 0 25px 50px -12px rgb(0 0 0 / 0.25) */
shadow-none
box-shadow: 0 0 #0000;
shadow-(<custom-property>)
box-shadow: var(<custom-property>);
shadow-(color: <custom-property>)
--tw-shadow-color: var(<custom-property>);

Examples

Basic example

Reach for utilities such as shadow-sm and shadow-lg to cast outer box shadows of different sizes on an element:

shadow-md

shadow-lg

shadow-xl

<div class="shadow-md ..."></div><div class="shadow-lg ..."></div><div class="shadow-xl ..."></div>

Adjusting the opacity

Reach for the opacity modifier whenever you want to dial back a box

shadow-xl

shadow-xl/20

shadow-xl/30

<div class="shadow-xl ..."></div><div class="shadow-xl/20 ..."></div><div class="shadow-xl/30 ..."></div>

Out of the box, shadow opacities stay fairly subtle (25% or less), so pushing the value higher (to something like 50%) makes your box shadows far more pronounced.

Choosing the shadow color

Reach for utilities such as shadow-indigo-500 and shadow-cyan-500/50 to tint the color of a box shadow:

shadow-cyan-500/50

shadow-blue-500/50

shadow-indigo-500/50

<button class="bg-cyan-500 shadow-lg shadow-cyan-500/50 ...">Subscribe</button><button class="bg-blue-500 shadow-lg shadow-blue-500/50 ...">Subscribe</button><button class="bg-indigo-500 shadow-lg shadow-indigo-500/50 ...">Subscribe</button>

Colored shadows arrive fully opaque at 100% by default, though the opacity modifier lets you soften them as needed.

Placing an inset shadow

Reach for utilities such as inset-shadow-xs and inset-shadow-sm to sink an inset box shadow into any element:

inset-shadow-2xs

inset-shadow-xs

inset-shadow-sm

<div class="inset-shadow-2xs ..."></div><div class="inset-shadow-xs ..."></div><div class="inset-shadow-sm ..."></div>

Tune the opacity of an inset shadow through the opacity modifier, written as inset-shadow-sm/50. Since the default inset shadow opacities sit rather low (5%), bumping the value up (to something like 50%) makes those inset shadows read far more clearly.

Choosing the inset shadow color

Lean on utilities such as inset-shadow-indigo-500 and inset-shadow-cyan-500/50 to recolor the inset box shadow on any element:

inset-shadow-indigo-500

inset-shadow-indigo-500/50

<div class="inset-shadow-sm inset-shadow-indigo-500 ..."></div><div class="inset-shadow-sm inset-shadow-indigo-500/50 ..."></div>

Placing a ring

Placing a ring

Grab ring or ring-<number> utilities such as ring-2 and ring-4 to lay a solid box-shadow onto an element:

ring

ring-2

ring-4

<button class="ring ...">Subscribe</button><button class="ring-2 ...">Subscribe</button><button class="ring-4 ...">Subscribe</button>

Out of the box, rings inherit the currentColor of whatever element they wrap.

Choosing the ring color

Reach for utilities such as ring-indigo-500 and ring-cyan-500/50 to recolor any ring:

ring-blue-500

ring-blue-500/50

<button class="ring-2 ring-blue-500 ...">Subscribe</button><button class="ring-2 ring-blue-500/50 ...">Subscribe</button>

Rings render at a full 100% opacity by default, yet the opacity modifier lets you tune that down.

Placing an inset ring

Grab inset-ring or inset-ring-<number> utilities such as inset-ring-2 and inset-ring-4 to lay a solid inset box-shadow onto an element:

inset-ring

inset-ring-2

inset-ring-4

<button class="inset-ring ...">Subscribe</button><button class="inset-ring-2 ...">Subscribe</button><button class="inset-ring-4 ...">Subscribe</button>

Out of the box, inset rings inherit the currentColor of whatever element they wrap.

Choosing the inset ring color

Reach for utilities such as inset-ring-indigo-500 and inset-ring-cyan-500/50 to recolor an inset ring:

inset-ring-blue-500

inset-ring-blue-500/50

<button class="inset-ring-2 inset-ring-blue-500 ...">Subscribe</button><button class="inset-ring-2 inset-ring-blue-500/50 ...">Subscribe</button>

Inset rings render at a full 100% opacity by default, yet the opacity modifier lets you tune that down.

Clearing a box shadow

Reach for the shadow-none, inset-shadow-none, ring-0, and inset-ring-0 utilities whenever you want to strip an existing box shadow off an element.

shadow-none

<div class="shadow-none ..."></div>

Using a custom value

Reach for utilities like shadow-[<value>], inset-shadow-[<value>], ring-[<value>], and inset-ring-[<value>] when you need a box shadow driven by a fully custom value of your own:

<div class="shadow-[0_35px_35px_rgba(0,0,0,0.25)] ...">  <!-- ... --></div>

When you're leaning on CSS variables, the shadow-(<custom-property>) syntax has you covered.

<div class="shadow-(--my-shadow) ...">  <!-- ... --></div>

Think of it as a tidy shorthand for shadow-[var(<custom-property>)] that wraps things in the var() function on your behalf.

Responsive design

Add a breakpoint variant such as md: in front of a box-shadow utility so it kicks in only from medium screen sizes on up:

<div class="shadow-none md:shadow-lg ...">  <!-- ... --></div>

Dig deeper into working with variants over variants documentation.

Customizing your theme

Customizing shadows

Reach for the --shadow-* theme variables to tailor the box shadow utilities across your whole project:

@theme {  --shadow-3xl: 0 35px 35px rgba(0, 0, 0, 0.25); }

From here, the shadow-3xl utility is ready to drop straight into your markup:

<div class="shadow-3xl">  <!-- ... --></div>

Read up on tailoring your theme further over in the theme documentation.

Customizing inset shadows

Reach for the --inset-shadow-* theme variables to tailor the inset box shadow utilities across your project:

@theme {  --inset-shadow-md: inset 0 2px 3px rgba(0, 0, 0, 0.25); }

From here, the inset-shadow - md utility is ready to drop straight into your markup:

<div class="inset-shadow-md">  <!-- ... --></div>

Read more about tailoring your theme over in the theme documentation.

Customizing shadow colors

Reach for the --color-* theme variables to tailor the color utilities across your whole project:

@theme {  --color-regal-blue: #243c5a; }

From here, utilities such as shadow-regal-blue, inset-shadow-regal-blue, ring-regal-blue, and inset-ring-regal-blue are ready to use in your markup:

<div class="shadow-regal-blue">  <!-- ... --></div>

Read more about tailoring your theme colors over in the theme documentation.

Copyright © 2026 Breezel, Inc.·Trademark Policy