How to use the CSS Box Shadow Generator
- Move the sliders
- See the live preview
- Copy the CSS
Build a shadow visually
Drag the sliders for horizontal offset, vertical offset, blur, spread and opacity, pick the shadow, box and background colours, and tick Inset for an inner shadow. The preview updates live and the CSS is ready to copy.
Syntax and examples
The syntax is box-shadow: [inset] x y blur spread color;. Some starting points:
- Card:
0 4px 12px rgba(0, 0, 0, 0.1) - Button:
0 2px 4px rgba(0, 0, 0, 0.2) - Bottom edge only:
0 8px 6px -6px rgba(0, 0, 0, 0.3)โ the negative spread hides the sides. For the top edge only, use a negative y offset. - Even glow on all sides:
0 0 12px rgba(0, 0, 0, 0.2) - Inner shadow:
inset 0 2px 6px rgba(0, 0, 0, 0.25)
For a smoother, more realistic look, combine two or three soft shadows separated by commas. On dark themes shadows barely show, so a lighter border or a soft glow often works better.
Tailwind, drop-shadow and React Native
- Tailwind CSS โ use an arbitrary value:
shadow-[0_4px_12px_rgba(0,0,0,0.1)]. - drop-shadow โ
filter: drop-shadow(0 4px 6px rgba(0,0,0,.3))follows the shape of transparent PNGs and SVGs, but has no spread or inset. - React Native 0.76+ (New Architecture) accepts the same
boxShadowstring.
Shadow not showing?
Check that the parent doesn't have overflow: hidden (it clips shadows), that the colour isn't fully transparent, and that the element actually has a width and height.