Skip to content
IndexRequest a UIAboutContact

Soft UI Raised & Pressed

Raised soft buttons and toggles that sink in when pressed, an inset field and a depth slider.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Design a soft UI (neumorphic) control set on a light warm-grey surface (#E8E8E4): a rounded 14 pixel raised button labelled "Play" with a light shadow at the top left (-6px -6px 12px white) and a darker shadow at the bottom right (6px 6px 12px rgba(0,0,0,0.12)), which changes to an inset shadow while pressed; a pill toggle that sinks in and shows a small accent dot when on; and an inset text field with the placeholder "Search". Add a "Depth" slider that scales all shadow distances from 2 to 12 pixels. Keep text near-black for contrast, add a 2 pixel focus outline, 150 millisecond shadow transitions and a prefers-reduced-motion fallback. Plain HTML and CSS with a little JavaScript for the slider and toggle.

About this pattern

Definition

Soft UI (neumorphism) makes controls look moulded from the same material as the background. A light shadow on one side and a dark shadow on the other make an element look raised; swapping them to inset makes it look pressed in.

Purpose & UX principles

  • Gives a calm, tactile look for dashboards, music players and smart-home controls.
  • Contrast is low by nature: keep text dark, add icons or labels, and never rely on shadow alone to show state.
  • Use sparingly; combine with clear focus outlines and a visible active colour for toggles.

Interaction states

  • Raised (default), hover (slightly stronger), pressed (inset), focus-visible (outline), toggled on (inset plus accent dot).

Motion specification

  • Shadows transition over 150ms ease; slider updates depth live.
  • Reduced motion: instant change.

Responsive behaviour

  • Reduce shadow distance on small screens so adjacent controls do not blur together.
  • Keep touch targets at least 44px.

Code

HTML
<div class="bx" id="bx"><button class="sb" id="pl" type="button">▶ Play</button><button class="tg" id="tg" type="button" role="switch" aria-checked="false"><i></i><span>Shuffle</span></button><input class="fl" placeholder="Search" aria-label="Search"><label class="ctl">Depth <input id="dp" type="range" min="2" max="12" value="6"></label></div>

Related patterns

Liquid Glass Button

↗
Liquid Glass ButtonGlass & Tactile

Press Feedback

↗
Press FeedbackButtons & Actions

Frosted Glass & Acrylic

↗
Frosted Glass & AcrylicSurfaces & Objects