CSS Neumorphic Inset Field
A soft UI search field carved into the surface with paired inset shadows and a clear focus ring.
<label class="neu-field">
<span>Search</span>
<input type="search" placeholder="Find a snippet">
</label>
.neu-field {
display: grid;
gap: 8px;
width: 230px;
color: #475569;
font: 600 13px system-ui, sans-serif;
}
.neu-field input {
box-sizing: border-box;
width: 100%;
padding: 14px 18px;
border: 0;
border-radius: 14px;
background: #e0e5ec;
color: #1e293b;
font: 15px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
box-shadow:
inset 5px 5px 10px #a3b1c6,
inset -5px -5px 10px #ffffff;
}
.neu-field input::placeholder {
color: #64748b;
}
.neu-field input:focus-visible {
outline: 2px solid #6366f1;
outline-offset: 3px;
}
About this CSS Neumorphic Inset Field
This CSS Neumorphic Inset Field is 32 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid and keyboard focus styles. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#475569#e0e5ec#1e293b#a3b1c6#ffffff#64748b#6366f1
How to use this neumorphic inset field
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.neu-fieldclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.