Neumorphic Button
The foundational neumorphic pattern. Button is the same color as the background — only paired shadows (light top-left, dark bottom-right) give it shape. On :active, both shadows move inside for a pressed look.
<button class="neu-btn">Click me</button> <!-- Must sit on the SAME background color --> <body style="background: #e0e5ec">
Icon Button
A round variant for navigation or controls. Uses the same shadow pairing as the text button — the circular shape makes the extrusion read especially well.
<button class="neu-icon" aria-label="play"> <i class="ph-fill ph-play"></i> </button>
Toggle Button
A button that stays "pressed" after you click — for binary on/off states like bold/italic in a toolbar. Uses :has(input:checked) to flip between raised and inset shadows.
<label class="neu-toggle-btn"> <input type="checkbox"/> Bold </label>
Text Field
Inputs go the other way — they're recessed. Starting from the raised button and moving both shadows inside gives a pocket-like indent. On focus, add an accent ring.
<input class="neu-input" placeholder="Your name"/>
Search Bar
A compound component: the outer pill is recessed (inset shadow), and the submit icon inside is raised. Mixing inset + raised within one component is the essence of neumorphic UI.
<div class="neu-search"> <input type="text" placeholder="Search..."/> <button><i class="ph ph-magnifying-glass"></i></button> </div>
Slider
Track is a recessed pill, fill is a gradient, and the thumb is a raised circle. The contrast between inset track and raised thumb is what gives the slider its "real" feel.
<div class="neu-slider"> <div class="fill"></div> <div class="thumb"></div> </div>
Switch
Track is recessed. Thumb is raised, slides right, and tints to the accent color when checked. Same underlying formula as the slider — this time the "thumb" does all the work.
<label class="neu-switch"> <input type="checkbox"/> <span class="track"></span> <span class="thumb"></span> </label>
Checkbox
Recessed square. When checked, an SVG tick draws itself in using stroke-dashoffset. Keeps the minimal neumorphic silhouette even when active.
<label class="neu-check">
<input type="checkbox"/>
<span class="box">
<svg class="tick" viewBox="0 0 14 14">
<polyline points="1.5 7 6 11 13 3"/>
</svg>
</span>
Remember me
</label>
Radio
An inset circle with a small raised dot inside when selected. The dot pops in with a spring scale for feedback.
<label class="neu-radio"> <input type="radio" name="plan"/> <span class="outer"><span class="dot"></span></span> Pro </label>
Card
A soft container — the button pattern scaled up. Use generous padding + larger border-radius and slightly deeper shadows so the card reads as a distinct elevated surface.
Weekly Summary
Your productivity is up 12% this week. Keep the streak going.
<div class="neu-card">
<h4>Weekly Summary</h4>
<p>Your productivity is up 12%...</p>
<div class="card-row">
<button class="neu-btn">View report</button>
<label class="neu-switch">...</label>
</div>
</div>
Stat Tile
Classic dashboard tile: the outer shell is raised, the ring (circular "bezel") inside is recessed. A little like a pressed-in badge — useful for KPIs or rankings.
<div class="neu-stat"> <div class="ring">A+</div> <div class="val">92%</div> <div class="lbl">Credit Score</div> </div>
Mini Player
A composite that uses most of the patterns in this lab — raised card, raised cover, inset progress bar, raised icon buttons. Shows how neumorphic pieces combine into a real-looking UI.
<div class="neu-player">
<div class="cover"></div>
<div class="title">Golden Hour</div>
<div class="artist">The Morning Light</div>
<div class="progress"><div class="progress-fill"></div></div>
<div class="controls">
<button class="neu-icon"><i class="ph-fill ph-skip-back"></i></button>
<button class="neu-icon main"><i class="ph-fill ph-play"></i></button>
<button class="neu-icon"><i class="ph-fill ph-skip-forward"></i></button>
</div>
</div>