32 CSS Search Box & Search Bar Designs

Compact Mobile

Mobile-first compact pattern — generous tap target, soft rounded chrome, single-line visual rhythm. Ideal for thumb-reach.

Pure CSS MIT licensed

Compact Mobile the 26th of 32 designs in the 32 CSS Search Box & Search Bar Designs collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<form class="csb-mob" role="search">
  <label class="csb-sr" for="csb-mob-i">Search</label>
  <svg viewBox="0 0 24 24" aria-hidden="true">
    <circle cx="11" cy="11" r="7" />
    <path d="m20 20-3.5-3.5" />
  </svg>
  <input id="csb-mob-i" type="search" name="q" inputmode="search" placeholder="Search..." />
</form>
.csb-mob {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: #2a2a3e;
  border-radius: 14px;
  min-height: 44px;
  min-width: 280px;
}
.csb-mob:focus-within { background: #1f1f28; box-shadow: 0 0 0 2px rgba(124,108,255,0.4); }
.csb-mob svg { width: 18px; height: 18px; fill: none; stroke: #b8b6d4; stroke-width: 2; stroke-linecap: round; }
.csb-mob input {
  flex: 1; padding: 0;
  border: 0; outline: none; background: transparent;
  color: #f0eeff; font: 500 16px/1 system-ui, sans-serif;
}
.csb-mob input::placeholder { color: #b8b6d4; }

.csb-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

Search CodeFronts

Loading…