Empty Search Results
A copy-paste error & 404 pages component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Error & 404 PagesHTMLCSSany framework
astronaut recipes
0results
Try different keywords or check for typos.
Copy into your project
HTML
<div class="nuda-err-nosrch">
<div class="nuda-err-nosrch__field">
<svg class="nuda-err-nosrch__icon" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8" />
<line x1="21" y1="21" x2="16.65" y2="16.65" />
</svg>
<span class="nuda-err-nosrch__query">astronaut recipes</span>
</div>
<div class="nuda-err-nosrch__empty">
<span class="nuda-err-nosrch__zero">0</span>
<span class="nuda-err-nosrch__label">results</span>
</div>
<p class="nuda-err-nosrch__tip">Try different keywords or check for typos.</p>
</div>CSS
.nuda-err-nosrch {
display: flex;
flex-direction: column;
align-items: center;
padding: 24px 20px;
background: #141414;
border: 1px solid rgba(255,255,255,.08);
border-radius: 16px;
text-align: center;
width: 100%;
max-width: 260px;
gap: 12px;
}
.nuda-err-nosrch__field {
display: flex;
align-items: center;
gap: 6px;
padding: 7px 12px;
background: #1e1e1e;
border: 1px solid rgba(255,255,255,.1);
border-radius: 8px;
width: 100%;
}
.nuda-err-nosrch__icon {
width: 14px;
height: 14px;
color: #555;
flex-shrink: 0;
}
.nuda-err-nosrch__query {
color: #cfcfcf;
font-size: 11px;
font-style: italic;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.nuda-err-nosrch__empty {
display: flex;
align-items: baseline;
gap: 4px;
}
.nuda-err-nosrch__zero {
font-size: 48px;
font-weight: 900;
font-family: ui-monospace,monospace;
color: #2a2a2a;
line-height: 1;
animation: _nuda-errnosrch-pop .4s ease-out both;
}
.nuda-err-nosrch__label {
font-size: 14px;
font-weight: 600;
color: #3a3a3a;
}
.nuda-err-nosrch__tip {
color: #555;
font-size: 10px;
line-height: 1.5;
margin: 0;
}
@keyframes _nuda-errnosrch-pop {
from {
transform: scale(.6);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-err-nosrch__zero {
animation: none;
}
}
How to use Empty Search Results
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.