Skip to content

Box Shadow

Use box-shadow utilities to apply outer shadow effects to elements. Shadows add depth and visual hierarchy to your interface.

Use utilities like shadow-sm and shadow-lg to apply different sized outer box shadows to an element:

Style('shadow-md ...')
Style('shadow-lg ...')
Style('shadow-xl ...')

Use the opacity modifier to adjust the opacity of the box shadow:

Style('shadow-xl ...')
Style('shadow-xl/20 ...')
Style('shadow-xl/30 ...')

The default box shadow opacities are quite low (25% or less), so increasing the opacity (to like 50%) will make the box shadows more pronounced.

Use utilities like shadow-indigo-500 and shadow-cyan-500/50 to change the color of a box shadow:

Style('bg-cyan-500 shadow-lg shadow-cyan-500/50 ...', child: Text('Subscribe'))
Style('bg-blue-500 shadow-lg shadow-blue-500/50 ...', child: Text('Subscribe'))
Style('bg-indigo-500 shadow-lg shadow-indigo-500/50 ...', child: Text('Subscribe'))

By default colored shadows have an opacity of 100% but you can adjust this using the opacity modifier.

Use utilities like inset-shadow-xs and inset-shadow-sm to apply an inset box shadow to an element:

Style('inset-shadow-2xs ...')
Style('inset-shadow-xs ...')
Style('inset-shadow-sm ...')

You can adjust the opacity of an inset shadow using the opacity modifier, like inset-shadow-sm/50. The default inset shadow opacities are quite low (5%), so increasing the opacity (to like 50%) will make the inset shadows more pronounced.

Use utilities like inset-shadow-indigo-500 and inset-shadow-cyan-500/50 to change the color of an inset box shadow:

Style('inset-shadow-sm inset-shadow-indigo-500 ...')
Style('inset-shadow-sm inset-shadow-indigo-500/50 ...')

By default colored inset shadows have an opacity of 100% but you can adjust this using the opacity modifier.

Use ring or ring-<number> utilities like ring-2 and ring-4 to apply a solid box-shadow to an element:

Style('ring ...', child: Text('Subscribe'))
Style('ring-2 ...', child: Text('Subscribe'))
Style('ring-4 ...', child: Text('Subscribe'))

By default rings match the currentColor of the element they are applied to.

Use utilities like ring-indigo-500 and ring-cyan-500/50 to change the color of a ring:

Style('ring-2 ring-blue-500 ...', child: Text('Subscribe'))
Style('ring-2 ring-blue-500/50 ...', child: Text('Subscribe'))

Use inset-ring or inset-ring-<number> utilities like inset-ring-2 and inset-ring-4 to apply a solid inset box-shadow to an element:

Style('inset-ring ...', child: Text('Subscribe'))
Style('inset-ring-2 ...', child: Text('Subscribe'))
Style('inset-ring-4 ...', child: Text('Subscribe'))

Use utilities like inset-ring-indigo-500 and inset-ring-cyan-500/50 to change the color of an inset ring:

Style('inset-ring-2 inset-ring-blue-500 ...', child: Text('Subscribe'))
Style('inset-ring-2 inset-ring-blue-500/50 ...', child: Text('Subscribe'))

Use the shadow-none, inset-shadow-none, ring-0, and inset-ring-0 utilities to remove an existing box shadow from an element:

Style('shadow-none ...')
ClassDescription
shadow-2xsApply a 2x extra small box shadow
shadow-xsApply an extra small box shadow
shadow-smApply a small box shadow
shadowApply a normal box shadow
shadow-mdApply a medium box shadow
shadow-lgApply a large box shadow
shadow-xlApply an extra large box shadow
shadow-2xlApply a 2x extra large box shadow
shadow-noneRemove any box shadow
shadow-{color}Override the box-shadow color (e.g. shadow-cyan-500)
shadow-{color}/{opacity}Color override with explicit alpha (e.g. shadow-cyan-500/50)
shadow-{size}/{opacity}Size with alpha override (e.g. shadow-xl/20)
inset-shadow-2xsApply a 2x extra small inset box shadow
inset-shadow-xsApply an extra small inset box shadow
inset-shadow-smApply a small inset box shadow
inset-shadow-noneRemove any inset box shadow
inset-shadow-{color}Override the inset shadow color
inset-shadow-{color}/{opacity}Inset color override with alpha
inset-shadow-{size}/{opacity}Inset size with alpha override