Neumorphism CSS Generator

Create soft UI and neumorphic CSS effects with a live preview. Customize the surface color, shadow depth, blur, radius, light direction, and shape, then copy ready-to-use CSS in seconds.

Project notes

Same surface color, light shadow, dark shadow.

.soft-ui {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 280px;
  height: 168px;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 20px 20px;
  background: #e4e9f2;
  color: #1e293b;
  font: inherit;
  box-shadow: 8.49px 8.49px 24px #bdc1c9, -8.49px -8.49px 24px #e7ebf4;
}

Label contrast is 12.01:1. Shadows are not a focus style; the button, input, and toggle CSS include an outline.

Advanced

Advertisement

Quick answer

A neumorphism CSS generator turns a surface color into a soft UI shadow: one highlight, one shade, a radius, and a light direction. Pick a card, button, input, toggle, circle, or panel, then copy the CSS that matches the preview.

The highlight and shade are calculated from the color you choose. They are not a fixed gray pair, so a blue-gray surface and a warm surface do not share the same shadow hex values.

What is neumorphism?

Neumorphism, often called soft UI, is a look where controls appear molded from the background. The element and the surface share a color. A light shadow sits toward the lamp and a dark shadow sits on the opposite side. That pair is what makes the edge look soft instead of outlined.

It showed up in interface experiments around 2020. It is useful for a small set of controls on a plain background. It is a poor fit for dense pages, tiny type, or anything that must stay obvious in bright sunlight.

What is a neumorphism CSS generator?

It is a visual editor for that shadow pair. You change color, size, radius, distance, blur, intensity, and where the light sits. The page writes the CSS, including inset shadows for a pressed or concave shape and a gradient for concave and convex surfaces.

Use it when you want neumorphic button CSS, a neumorphic card, or an inset field without hand-tuning two hex colors every time the palette changes.

How to use the neumorphism CSS generator

  1. Choose a component. Start from Card, Button, Input, Toggle, Circle, or Panel.
  2. Set the surface. Pick a surface color. The light and dark shadows are calculated from that color.
  3. Tune depth and light. Adjust distance, blur, intensity, radius, and light direction. Switch between raised, pressed, flat, concave, and convex.
  4. Copy the CSS. Copy CSS, the box-shadow value, Tailwind, variables, HTML, or React. Download the CSS or share the URL.

How neumorphism works in CSS

The readable part of the effect is box-shadow with two layers. For a light at the top left, a raised card looks like this shape: a positive offset in a darker color, and a negative offset in a lighter color. Pressed UI CSS puts inset on both layers so the shade falls inside the edge.

border-radius sells the softness. A square with the same shadows looks like a tile. A fully rounded control becomes a circle or a pill. The element background has to match the stage behind it, or the extrusion breaks and you just have a drop shadow. Need a different corner system later? The border radius generator edits that property on its own.

How the shadow colors are chosen

The surface color is converted to OKLab. Intensity moves lightness up for the light shadow and down for the dark shadow. Lightness is kept inside a band so a white surface does not produce #ffffff and a black surface does not produce #000000. Optional custom colors replace those results when you set them under Advanced.

  • Surface color is the element and the stage.
  • Light shadow is the lit edge.
  • Dark shadow is the far edge.
  • Distance is the offset length. Angle turns that length into X and Y. 0° is light from the top. 315° is the usual top-left lamp.
  • Blur spreads each shadow. Spread, in Advanced, grows it before the blur.
  • Raised and convex use outer shadows. Pressed and concave use inset. Flat keeps the same pair at a short distance.

CSS examples

Neumorphic card

.soft-ui {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 280px;
  height: 168px;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 20px 20px;
  background: #e4e9f2;
  color: #1e293b;
  font: inherit;
  box-shadow: 8.49px 8.49px 24px #bdc1c9, -8.49px -8.49px 24px #e7ebf4;
}

Neumorphic button

.soft-ui {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px 14px 14px 14px;
  background: #e4e9f2;
  color: #1e293b;
  font: inherit;
  box-shadow: 4.24px 4.24px 12px #c0c4cc, -4.24px -4.24px 12px #e7ebf4;
}
.soft-ui:focus-visible {
  outline: 2px solid #3730a3;
  outline-offset: 3px;
}
.soft-ui:active {
  box-shadow: inset 4.24px 4.24px 12px #c0c4cc, inset -4.24px -4.24px 12px #e7ebf4;
}

Neumorphic input

.soft-ui {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 260px;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px 12px 12px 12px;
  background: #e4e9f2;
  color: #1e293b;
  font: inherit;
  box-shadow: inset 3.54px 3.54px 10px #c1c5cd, inset -3.54px -3.54px 10px #e7ebf4;
}
.soft-ui:focus-visible {
  outline: 2px solid #3730a3;
  outline-offset: 3px;
}

Pressed button

.soft-ui {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px 14px 14px 14px;
  background: #e4e9f2;
  color: #1e293b;
  font: inherit;
  box-shadow: inset 4.24px 4.24px 12px #c0c4cc, inset -4.24px -4.24px 12px #e7ebf4;
}
.soft-ui:focus-visible {
  outline: 2px solid #3730a3;
  outline-offset: 3px;
}
.soft-ui:active {
  box-shadow: inset 4.24px 4.24px 12px #c0c4cc, inset -4.24px -4.24px 12px #e7ebf4;
}

Toggle

.soft-ui {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 72px;
  height: 40px;
  padding: 4px;
  border: 0;
  border-radius: 240px 240px 240px 240px;
  background: #e4e9f2;
  color: #1e293b;
  font: inherit;
  box-shadow: inset 3.54px 3.54px 10px #c1c5cd, inset -3.54px -3.54px 10px #e7ebf4;
}
.soft-ui:focus-visible {
  outline: 2px solid #3730a3;
  outline-offset: 3px;
}
.soft-ui-knob {
  width: 29px;
  height: 29px;
  border-radius: 999px;
  background: #e4e9f2;
  box-shadow: 3.54px 3.54px 10px #c1c5cd, -3.54px -3.54px 10px #e7ebf4;
}

Where soft UI CSS gets used

Designers use a soft UI generator to try a card or a panel before committing the palette. Frontend developers use a CSS neumorphism generator when a mock asks for a neumorphic button or an inset search field and they need the shadow value, not a screenshot.

A neumorphism shadow generator is the same job as a neumorphism box shadow generator: two shadows that stay attached to one surface. An input wants the pressed form. A toggle wants a pressed track and a raised knob, which is why that preset writes both rules. A circle is the same raised math with equal width and height.

Neumorphism vs box shadow

A normal drop shadow lifts an object off a different background. Neumorphism needs the backgrounds to match, and it needs the second shadow as a highlight. If you only want layered drop shadows, offsets, and spread on their own, use the CSS box shadow generator.

Neumorphism vs glassmorphism

Soft UI is opaque and monochrome. Glassmorphism is a translucent panel over a busy background, usually with backdrop-filter. They solve different problems. Compare the frosted look in the glassmorphism generator. A gradient behind that panel is a separate step: the CSS gradient generator builds the background, and blur lives on the CSS filter generator.

Raised vs pressed neumorphism

Raised is the default card and button. The dark shadow falls away from the light and the light shadow sits on the near edge. Pressed reverses the depth with inset. Concave uses that inset shadow plus a gradient that darkens toward the light. Convex uses the outer shadow plus a gradient that lightens toward the light. Flat is the same highlight and shade pulled in close, for a control that should not look tall.

Buttons should not stop at the raised shadow. The button preset adds :active with the pressed shadow so a click has a state. Pair it with real button CSS from the CSS button generator when you also need hover color, padding, and type.

Common neumorphism mistakes

  • Using a different color behind the element. The soft edge disappears.
  • Hard-coding #ffffff and a gray shadow after the surface color changes.
  • Setting distance and blur so low that the control has no edge.
  • Setting them so high that the shape looks muddy.
  • Putting the effect on small text.
  • Skipping focus and active styles, so the control only looks clickable to people who can see the shadow.
  • Stacking several neumorphic layers until nothing has a clear level.

Accessibility

Check the contrast note in the tool. Body text on the surface should reach 4.5:1. The preview picks a dark or light label for that reason. Shadows are not a focus style. Button, input, and toggle CSS include :focus-visible with a solid outline.

If the warning stays on after you darken the text, the surface itself is too close to both black and white to carry a soft UI and readable type. Change the surface, or confirm the pair with the color contrast checker.

Frequently asked questions

What is neumorphism in CSS?

Neumorphism, also called soft UI, makes a control look raised from or pressed into a background of the same color. CSS does that with two opposite box-shadows: a lighter one toward the light and a darker one away from it.

How do I create a neumorphic button in CSS?

Use the Button preset, keep the button the same color as the surface behind it, and copy the CSS. The rule includes an :active state that switches to an inset shadow so the button looks pressed.

How does a neumorphism generator calculate shadows?

It converts the surface color to OKLab, raises the lightness for the highlight, and lowers it for the shade. Those colors are clamped so they do not become pure white or pure black. Distance and angle set the X and Y offsets.

Why does neumorphism use two shadows?

One shadow is the highlight on the lit edge. The other is the shade on the far edge. A single drop shadow reads as a floating card, not as a shape pushed out of the same surface.

What is the difference between raised and pressed neumorphism?

Raised uses outer shadows, so the shape comes forward. Pressed uses inset shadows, so it looks pushed in. Concave and convex add a gradient on top of that, which flat deliberately keeps very small.

Can I use neumorphism for buttons and inputs?

Yes, if the label or placeholder has enough contrast and the control has a visible focus outline. Shadow alone is a weak boundary. The Button, Input, and Toggle presets include a focus outline for that reason.

Is neumorphism accessible?

Not by default. Low-contrast shadows fail when someone needs a clear edge. Keep text at 4.5:1 against the surface, add a focus ring, and do not use the effect for the only sign that something is clickable.

Can I use generated CSS with Tailwind?

Yes. The Tailwind tab uses arbitrary background, radius, text, and shadow utilities that match the preview. You can also copy the plain CSS or the CSS variables.

Does this neumorphism generator run in the browser?

Yes. Color math, preview, copy, download, and the share URL all run in the page. Nothing is uploaded.