A neumorphism generator for soft UI
Neumorphism, or soft UI, makes an element look as if it is pressed out of (or into) the page. The element has the same color as its background and is shaped only by two shadows: a darker one on the side facing away from the light and a lighter one on the side facing it. This neumorphism generator calculates both shadow colors from your base color, so they always match.
Example output
With the default base color #e0e5ec, a 20px distance and 15% intensity:
.neumorphic {
border-radius: 50px;
background: #e0e5ec;
box-shadow: 20px 20px 60px #bec3c9,
-20px -20px 60px #ffffff;
}
The Pressed shape uses the same two shadows with the inset keyword, so the element appears sunk into the surface:
box-shadow: inset 20px 20px 60px #bec3c9,
inset -20px -20px 60px #ffffff;
Options explained
- Intensity sets how far the shadow colors move from the base. The dark shadow multiplies each RGB channel by (1 − intensity) and the light shadow by (1 + intensity), capped at 255.
- Distance is the shadow offset in px; Blur softens the edge. The defaults use a blur three times the distance, which keeps the edges soft.
- Shape: Flat uses a solid background; Concave adds a dark-to-light gradient so the face looks dished; Convex reverses it so the face bulges; Pressed switches to inset shadows.
- Light source flips the offsets and the gradient angle. With the light at the top right, the dark shadow moves to
-20px 20px. - Size only sizes the preview; add your own
widthandheight.
Tips and common mistakes
- Match the page color. The illusion breaks if the element sits on a different background. Set the parent's background to the base color.
- Avoid pure white or black. White cannot get lighter and black cannot get darker, so one shadow disappears. Even the default light shadow is already capped at
#ffffff; mid-tone base colors give both shadows room. - Mind accessibility. Soft UI has very low edge contrast, so buttons can be hard to spot. Give interactive elements a clear label, an icon or a visible
:focus-visibleoutline, and use it sparingly. - Use Pressed for states. A common pattern is Flat for a button's normal state and Pressed for
:activeor a toggled "on" state.
For ordinary drop shadows, the box shadow generator gives full control over each layer. For a translucent look over colorful backgrounds, try the glassmorphism generator, and check label colors with the contrast checker.
Privacy
Everything is calculated in your browser. Your colors and settings are not uploaded.