Location Search
A copy-paste maps & locations component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Maps & LocationsHTMLCSSany framework
Copy into your project
HTML
<div class="nuda-locsearch">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" />
<circle cx="12" cy="10" r="3" />
</svg>
<input placeholder="Search address or place…" />
<button class="nuda-locsearch__use" aria-label="Use my location">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="9" />
<path d="M16 8l-4 8-4-8 8 0z" fill="currentColor" />
</svg>
</button>
</div>CSS
.nuda-locsearch {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 6px 6px 6px 12px;
background: rgba(0,0,0,.3);
border: 1px solid rgba(255,255,255,.08);
border-radius: 99px;
color: #fafafa;
width: 100%;
max-width: 260px;
transition: border-color .25s,box-shadow .25s;
}
.nuda-locsearch:focus-within {
border-color: #e4ff54;
box-shadow: 0 0 0 3px rgba(228,255,84,.12);
}
.nuda-locsearch > svg {
width: 14px;
height: 14px;
color: #a0a0a8;
flex-shrink: 0;
transition: color .25s,transform .25s;
}
.nuda-locsearch:focus-within > svg {
color: #e4ff54;
transform: scale(1.1);
}
.nuda-locsearch input {
flex: 1;
min-width: 0;
background: transparent;
border: 0;
outline: none;
padding: 6px 0;
color: #fafafa;
font-size: 12px;
}
.nuda-locsearch input::placeholder {
color: #63636e;
}
.nuda-locsearch__use {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border-radius: 50%;
background: rgba(228,255,84,.1);
border: 0;
color: #e4ff54;
cursor: pointer;
flex-shrink: 0;
transition: background .2s,transform .3s;
}
.nuda-locsearch__use:hover {
background: #e4ff54;
color: #09090b;
transform: rotate(45deg);
}
.nuda-locsearch__use svg {
width: 14px;
height: 14px;
}
How to use Location Search
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.