Skip to content

Recent Searches

A copy-paste search & autocomplete component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Search & AutocompleteHTMLCSSany framework
Recent
loaders
spinners
magnetic button
aurora bg

Copy into your project

HTML
<div class="nuda-recent">
  <div class="nuda-recent__head">Recent</div>
  <div class="nuda-recent__item">
    <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="M12 7v5l3 2" />
    </svg>
    <span>loaders</span>
    <button aria-label="Remove">×</button>
  </div>
  <!-- More items -->
</div>
CSS
.nuda-recent {
  padding: 8px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  width: 100%;
  max-width: 240px;
}

.nuda-recent__head {
  color: #63636e;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 4px 8px 8px;
}

.nuda-recent__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  color: #a0a0a8;
  font-size: 12px;
  border-radius: 7px;
  cursor: pointer;
  animation: _recIn .4s cubic-bezier(.16,1,.3,1) both;
  transition: background .2s,color .2s;
}

.nuda-recent__item svg {
  width: 13px;
  height: 13px;
  color: #63636e;
  flex-shrink: 0;
}

.nuda-recent__item span {
  flex: 1;
}

.nuda-recent__item button {
  background: transparent;
  border: 0;
  color: #63636e;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0;
  transition: opacity .25s,color .2s,transform .25s;
}

.nuda-recent__item:hover {
  background: rgba(255,255,255,.04);
  color: #fafafa;
}

.nuda-recent__item:hover button {
  opacity: 1;
}

.nuda-recent__item button:hover {
  color: #ff5e7a;
  transform: scale(1.2);
}

@keyframes _recIn {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-recent__item {
    animation: none;
  }
}

How to use Recent Searches

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.

More search & autocomplete components

← Browse all NudaUI components