ModernCalcs

Neumorphism Generator – Soft UI CSS Builder

Generate neumorphic (soft UI) CSS with dual box-shadows. Pick a base color, tune the shadow distance and intensity, choose a shape variant, and copy production-ready CSS instantly.

Preview

Controls

Adjust sliders to tune the neumorphic effect in real time.

Shape

Shape & Shadow

Base color#e0e0e0
Size150px
Border radius20%

Shadow Parameters

Distance20px
Intensity0.15
Blur60px

#bababa

dark shadow

#ffffff

light shadow

CSS
.element {
  background: #e0e0e0;
  border-radius: 20%;
  box-shadow: 20px 20px 60px #bababa, -20px -20px 60px #ffffff;
}

Neumorphism Generator: Build Soft UI CSS with Dual Box-Shadows

Neumorphism (soft UI) sits between flat design and skeuomorphism. It uses a single background color with two subtle box-shadows — one dark, one light — to suggest a three-dimensional extrusion or indent, without mimicking real-world materials. The element appears to grow out of (or into) the surface itself.

Building neumorphic CSS by hand requires careful color arithmetic: the dark and light shadow colors must be derived from the exact base color, or the illusion collapses. This generator automates the math — pick your base color, tune the sliders, and copy production-ready CSS in one click.

Formula
box-shadow: {d}px {d}px {blur}px {darkColor}, -{d}px -{d}px {blur}px {lightColor}; background: {baseColor}; border-radius: {r}%;

The dark shadow goes bottom-right; the light shadow goes top-left. The element background must exactly match the page background. Dark shadow = base color darkened by intensity × 255; light shadow = base color lightened by the same amount.

Neumorphism vs Skeuomorphism vs Flat Design

**Skeuomorphism** (iOS 6 era) renders UI elements as realistic physical objects — leather textures, metal buttons, stitched seams. **Flat design** (iOS 7+) stripped all ornamentation, using solid colors and minimal shadows. **Neumorphism** sits between them: a single background color with two subtle box-shadows suggests soft three-dimensional depth without mimicking real-world materials. The key constraint: element background must exactly match the page background or the illusion breaks entirely.

How Two Box-Shadows Create the Raised / Inset Illusion

The effect simulates a light source hitting a surface from the top-left. A **dark shadow offset bottom-right** mimics the shadow cast away from the light. A **light shadow offset top-left** mimics the highlight where light strikes directly. For the **Inset (pressed) variant**, apply the `inset` keyword to both shadows to reverse the illusion — the element appears pushed into the surface rather than extruded from it. **Concave** and **Convex** add a subtle linear gradient over the same shadow pair to further emphasize the curvature direction.

Accessibility Challenges and When to Use Neumorphism

Neumorphism's fundamental constraint is that the element and page share nearly the same color — meaning very low contrast. WCAG 2.1 requires **3:1 contrast for UI components**. Neumorphic elements often fail this threshold.

The aesthetic works best in **controlled contexts**: internal dashboards, design tool UIs, settings panels, and card interfaces where users are not relying on contrast alone to identify interactive elements. Always add clear text labels, visible focus rings, and sufficient text contrast to compensate for the low element-to-background contrast.

Design Do's and Don'ts

**Works well:** dashboards and data cards, settings panels and sliders, dark-mode neumorphism on a dark base, mid-tone neutral backgrounds, decorative containers rather than primary CTA buttons.

**Avoid:** pure white or very dark backgrounds (no room for light/dark shadow contrast), primary action buttons for general audiences, small text on neumorphic backgrounds, high-contrast or accessibility-first products where WCAG compliance is non-negotiable.

Frequently Asked Questions

What is neumorphism?

Neumorphism (soft UI) is a design style where elements appear to be extruded from or pressed into the background surface. It uses two box-shadows — one dark, one light — to simulate a light source hitting a raised or inset shape. The element background must exactly match the page background color for the illusion to work.

What is the difference between neumorphism and skeuomorphism?

Skeuomorphism renders UI elements to look like real-world physical objects (leather textures, metal buttons, stitched seams — common in iOS 6). Neumorphism uses a single background color with dual shadows to suggest subtle three-dimensionality, without mimicking real-world materials. It is more abstract and minimal than skeuomorphism.

Why do neumorphic designs fail accessibility checks?

Neumorphic elements use very low contrast between the element and background because both share nearly the same color. WCAG requires 3:1 contrast for UI components and 4.5:1 for text. The subtle shadow difference that defines neumorphism is invisible to users with low vision or color blindness. Adding higher-contrast borders or text is essential.

What background colors work best for neumorphism?

Mid-tone neutral colors work best: light grays (e.g., #e0e0e0, #e8e8e8), warm off-whites, or pastel blues. Pure white (#ffffff) doesn't allow a lighter shadow. Pure dark backgrounds work for dark-mode neumorphism. Saturated or dark colors tend to make the dual shadows look muddy rather than crisp.

How do I make a neumorphic button in CSS?

Set the button background to match the page background. Add two box-shadows: a dark shadow offset bottom-right (e.g., 4px 4px 8px #bebebe) and a light shadow offset top-left (e.g., -4px -4px 8px #ffffff). For an inset (pressed) state, use inset on both shadows. The blur radius controls softness — higher blur looks softer.

What is the inset variant of neumorphism?

The inset variant makes the element appear pressed into the surface instead of raised above it. Add the 'inset' keyword to both box-shadows: box-shadow: inset 4px 4px 8px #bebebe, inset -4px -4px 8px #ffffff. This is used for active/pressed button states, input fields, and toggle-on states.

How is neumorphism different from glassmorphism?

Neumorphism relies on matched background colors and dual box-shadows — no transparency required. Glassmorphism relies on backdrop-filter blur and rgba transparency — it needs colorful content behind it. Neumorphism looks embedded in the surface; glassmorphism looks like a floating glass panel above a background.