Spotlight Overlay
A copy-paste command palette component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Command PaletteHTMLCSSany framework
Open settings
- Open Settings
- Open Profile
- Open API Keys
Copy into your project
HTML
<!-- Spotlight Overlay — wrap in a fixed/centered backdrop in production -->
<div class="nuda-spotlight">
<div class="nuda-spotlight__panel">
<div class="nuda-spotlight__search">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="7" />
<path d="M21 21 L16 16" />
</svg>
<input class="nuda-spotlight__query" placeholder="Type a command…" />
</div>
<div class="nuda-spotlight__divider"></div>
<ul class="nuda-spotlight__list">
<li class="nuda-spotlight__item is-active">Open Settings</li>
<li class="nuda-spotlight__item">Open Profile</li>
<li class="nuda-spotlight__item">Open API Keys</li>
</ul>
</div>
</div>CSS
/* Spotlight Overlay
Cmd-K style panel: query + divider + result list. Includes entry animation.
Customize: --sl-bg, --sl-accent */
.nuda-spotlight {
--sl-bg: rgba(20, 20, 24, 0.95);
--sl-accent: #e4ff54;
position: relative;
width: 100%;
max-width: 480px;
padding: 8px;
background: rgba(0, 0, 0, 0.4);
border-radius: 14px;
backdrop-filter: blur(8px);
}
.nuda-spotlight__panel {
background: var(--sl-bg);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
overflow: hidden;
animation: nuda-sl-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow:
0 16px 40px -8px rgba(0, 0, 0, 0.6),
0 0 0 1px rgba(228, 255, 84, 0.1);
}
.nuda-spotlight__search {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
color: #fafafa;
}
.nuda-spotlight__search svg {
width: 16px;
height: 16px;
color: #a1a1aa;
flex-shrink: 0;
}
.nuda-spotlight__query {
font: 500 0.875rem ui-sans-serif, system-ui, sans-serif;
flex: 1;
background: transparent;
border: none;
color: #fafafa;
outline: none;
}
.nuda-spotlight__query::placeholder { color: #63636e; }
.nuda-spotlight__divider {
height: 1px;
background: rgba(255, 255, 255, 0.06);
}
.nuda-spotlight__list {
list-style: none;
padding: 6px;
margin: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.nuda-spotlight__item {
padding: 8px 12px;
font: 500 0.875rem ui-sans-serif, system-ui, sans-serif;
color: #a1a1aa;
border-radius: 6px;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.nuda-spotlight__item:hover {
background: rgba(255, 255, 255, 0.04);
color: #fafafa;
}
.nuda-spotlight__item.is-active {
background: rgba(228, 255, 84, 0.1);
color: var(--sl-accent);
border: 1px solid rgba(228, 255, 84, 0.2);
}
@keyframes nuda-sl-in {
from { opacity: 0; transform: translateY(-8px) scale(0.96); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.nuda-spotlight__panel { animation: none; }
}How to use Spotlight Overlay
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.