User Rating 0.0
Total Usage 2 times
Category CSS Tools

Real-time Preview

Elevation
CSS Output
Global Light Source
315°
Element Properties
Shadow Layers
Copied to clipboard!
Is this tool helpful?

Your feedback helps us improve.

About

Shadows are not just decoration; they are the z-index of the visual world. In UI design, accurate shadows define hierarchy, affordance (clickability), and spatial relationships. Most generators create flat, lifeless shadows using a single layer. This tool utilizes Layered Interpolation to simulate real-world lighting physics, where light diffusion creates both a sharp umbra and a soft penumbra. It is designed for frontend developers who need production-ready CSS or Tailwind code without the guesswork.

We solve the "Floaty Effect" problem - where elements look like they are hovering unnaturally - by allowing precise control over ambient occlusion (the contact shadow) and direct light. Whether you need the soft extrusion of Neumorphism or the crisp stack of Material Design, this engine calculates the trigonometric offsets for you.

box-shadow generator css shadow neumorphism material design ui design tools tailwind shadow

Formulas

The core of realistic lighting lies in the relationship between the Light Source Angle (θ) and the shadow offset. We calculate the Cartesian coordinates for every layer i:

{
xi = distancei × cos(θ)yi = distancei × sin(θ)

For Neumorphism, the highlight layer acts as a reflection, calculated by rotating the angle by 180° (π radians). The intensity of the shadow (α) typically follows an inverse-square law relative to the blur radius (σ).

Reference Data

Shadow TypeLayersPhysics PrincipleBest ApplicationRef (opacity)
Material Level 12Ambient + Key LightCards, List Items0.12
Material Level 53High DiffusionModals, Dialogs0.30
Neumorphism2Extrusion (Light/Dark)Soft UI ButtonsMixed
Smooth Shadow5-6Gaussian DecayHero Sections0.05 avg
Inner Shadow1-2Recession/DepthInputs, Checkboxes0.15
Glow/Neon3+Light ScatteringDark Mode Accents0.80
Solid/Retro1No DiffusionBrutalist Design1.00
Contact Shadow1OcclusionFloating Objects0.60

Frequently Asked Questions

A single shadow looks artificial because real light sources cast complex shadows. By stacking multiple shadows - for example, one tight/dark shadow for the "contact" point and one large/light shadow for "atmosphere" - developers achieve a "smooth" look that blends seamlessly into the background. This technique is standard in design systems like Tailwind and Stripe.
The dial represents a global light source (like the sun). When you rotate it, the tool uses trigonometry to recalculate the X and Y offsets of every active shadow layer simultaneously. This ensures that if you have 5 layers, they all react to the light direction coherently, maintaining the illusion of a single physical object.
Box-shadows, especially with large blur radii, can be expensive for the browser to paint. However, modern browsers (Chrome, Safari, Firefox) optimize this heavily. To ensure 60fps animations, avoid animating the `blur` or `spread` radius. Instead, animate the `opacity` or the `transform` of the element.
Yes. The tool includes a toggle to generate `shadow-[...]` arbitrary value strings for Tailwind JIT (Just-In-Time) mode. This allows you to paste the complex shadow logic directly into your HTML classes without writing custom CSS files.
Outset shadows (default) make an element appear to float *above* the page. Inset shadows make the element appear to be cut *into* the page. Inset is crucial for form inputs, pressed buttons, and wells.