Section
Command Palette — Vercel
Refined dark monochrome Cmd+K command palette with hairline borders, a subtle radial glow, and a single teal accent. Live search filters grouped commands, arrow keys move the highlight, Enter runs the selected command with a confirmation toast, Escape closes, and Cmd/Ctrl+K toggles open. Focus is trapped inside the palette and restored to the trigger on close.
- Section
- Tailwind
- HTML
- MIT
What it does
Capabilities
- Dark monochrome surface with hairline borders
- Single teal accent and radial glow
- Live search filtering across grouped commands
- Arrow-key navigation with aria-activedescendant
- Enter runs command with confirmation toast
- Escape closes, Cmd/Ctrl+K toggles open
- Focus trap while open, focus restore on close
- Role dialog and role option with aria-selected
Preview
Live section
devsnips.site/library/tailwind/sections/developer/command-palette/vercel/ Install
Add to your project
npx devsnips add Tailwind/Sections/Developer/command-palette/vercel Tailwind/Sections/Developer/command-palette/vercel <!--
Snippet Name: Command Palette — Vercel
Description: Dark monochrome Cmd+K command palette with hairline borders, a teal accent, live search, grouped commands, and full keyboard navigation.
Author: DevSnips Contributors
Usage Example: Drop into a dark product shell. Click the trigger (or press Cmd/Ctrl+K) to open the palette.
-->
<div class="relative" data-cmd="vc">
<!-- Trigger -->
<button type="button" data-cmd-open
class="vc-mono group inline-flex items-center gap-2.5 rounded-lg border border-white/10 bg-[#0a0a0a] px-3.5 py-2 text-[13px] text-white/60 transition-colors hover:border-white/20 hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-white/30">
<svg class="h-3.5 w-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg>
Search commands
<span class="ml-1 inline-flex items-center gap-0.5 rounded border border-white/10 bg-white/[0.04] px-1.5 py-0.5 text-[10px] text-white/40">⌘K</span>
</button>
<!-- Overlay -->
<div data-cmd-overlay class="fixed inset-0 z-50 hidden items-start justify-center bg-black/70 px-4 pt-[14vh] backdrop-blur-sm" role="dialog" aria-modal="true" aria-labelledby="vc-cmd-title">
<div class="pointer-events-none absolute -inset-px -z-10 rounded-[14px] opacity-60 [background:radial-gradient(60%_60%_at_50%_0%,rgba(255,255,255,0.10),transparent_70%)]" aria-hidden="true"></div>
<div class="w-full overflow-hidden rounded-[14px] border border-white/10 bg-[#0a0a0a] shadow-[0_0_0_1px_rgba(255,255,255,0.02),0_20px_60px_-20px_rgba(0,0,0,0.9)]" data-cmd-panel>
<!-- Search -->
<div class="flex items-center gap-3 border-b border-white/[0.07] px-4 py-3.5">
<svg class="h-4 w-4 shrink-0 text-white/40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg>
<label id="vc-cmd-title" class="sr-only">Command palette</label>
<input
type="text"
data-cmd-input
placeholder="Type a command or search…"
aria-label="Search commands"
aria-autocomplete="list"
aria-controls="vc-cmd-list"
class="w-full bg-transparent font-g text-[15px] text-white placeholder:text-white/30 focus:outline-none"
/>
<span class="vc-mono shrink-0 rounded border border-white/10 bg-white/[0.04] px-1.5 py-0.5 text-[10px] text-white/40">esc</span>
</div>
<!-- List -->
<div class="cmd-scroll max-h-[52vh] overflow-y-auto py-2" data-cmd-list-wrap>
<ul id="vc-cmd-list" role="listbox" aria-label="Commands" data-cmd-list></ul>
<p data-cmd-empty class="hidden px-4 py-10 text-center font-g text-[13px] text-white/40">No matching commands</p>
</div>
<!-- Footer -->
<div class="flex flex-wrap items-center justify-between gap-2 border-t border-white/[0.07] px-4 py-2.5">
<div class="flex items-center gap-3 vc-mono text-[11px] text-white/40">
<span class="flex items-center gap-1"><kbd class="rounded border border-white/10 bg-white/[0.04] px-1.5 py-0.5">↑</kbd><kbd class="rounded border border-white/10 bg-white/[0.04] px-1.5 py-0.5">↓</kbd> navigate</span>
<span class="flex items-center gap-1"><kbd class="rounded border border-white/10 bg-white/[0.04] px-1.5 py-0.5">↵</kbd> run</span>
<span class="flex items-center gap-1"><kbd class="rounded border border-white/10 bg-white/[0.04] px-1.5 py-0.5">esc</kbd> close</span>
</div>
<span class="vc-mono flex items-center text-[11px] text-white/40"><span class="vc-dot"></span> DevSnips</span>
</div>
</div>
</div>
<!-- Confirmation toast -->
<div data-cmd-toast class="pointer-events-none fixed bottom-6 left-1/2 z-[60] hidden -translate-x-1/2 items-center gap-2 rounded-lg border border-white/10 bg-[#0a0a0a] px-4 py-2.5 font-g text-[13px] text-white shadow-[0_0_0_1px_rgba(255,255,255,0.02),0_20px_60px_-20px_rgba(0,0,0,0.9)]" role="status" aria-live="polite"></div>
<style>
[data-cmd="vc"] .vc-mono { font-family: 'Geist Mono', ui-monospace, monospace; }
[data-cmd="vc"] .font-g { font-family: 'Geist', sans-serif; }
[data-cmd="vc"] .vc-dot { display: inline-block; height: 6px; width: 6px; border-radius: 9999px; background: #50e3c2; margin-right: 6px; box-shadow: 0 0 8px #50e3c2; vertical-align: middle; }
[data-cmd="vc"] .cmd-scroll::-webkit-scrollbar { width: 6px; }
[data-cmd="vc"] .cmd-scroll::-webkit-scrollbar-track { background: transparent; }
[data-cmd="vc"] .cmd-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 9999px; }
[data-cmd="vc"] .cmd-scroll { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }
</style>
<script>
(function () {
var root = document.currentScript.closest('[data-cmd="vc"]');
if (!root) return;
var openBtn = root.querySelector('[data-cmd-open]');
var overlay = root.querySelector('[data-cmd-overlay]');
var panel = root.querySelector('[data-cmd-panel]');
var input = root.querySelector('[data-cmd-input]');
var list = root.querySelector('[data-cmd-list]');
var empty = root.querySelector('[data-cmd-empty]');
var toast = root.querySelector('[data-cmd-toast]');
var lastFocus = null;
var commands = [
{ group: 'Navigation', items: [
{ id: 'home', label: 'Go to Home', hint: 'Dashboard', kw: 'home dashboard', icon: 'M3 11l9-8 9 8M5 10v10h14V10' },
{ id: 'docs', label: 'Open Documentation', hint: 'Docs', kw: 'docs help guide', icon: 'M4 4h16v16H4zM8 8h8M8 12h8M8 16h5' },
{ id: 'snippets', label: 'Browse Snippets', hint: 'Library', kw: 'snippets library components', icon: 'M4 6h16M4 12h16M4 18h16' },
{ id: 'settings', label: 'Open Settings', hint: 'Account', kw: 'settings account config', icon: 'M12 8a4 4 0 100 8 4 4 0 000-8zM19 12a7 7 0 11-14 0 7 7 0 0114 0z' }
] },
{ group: 'Actions', items: [
{ id: 'new', label: 'New Snippet', hint: 'Create', kw: 'new create add', icon: 'M12 5v14M5 12h14' },
{ id: 'copy', label: 'Copy Current Snippet', hint: 'Duplicate', kw: 'copy duplicate clone', icon: 'M8 8h12v12H8M4 4h12v4M4 12v8h8' },
{ id: 'deploy', label: 'Deploy to Preview', hint: 'Ship', kw: 'deploy ship publish preview', icon: 'M5 12l5 5L20 7' },
{ id: 'share', label: 'Copy Share Link', hint: 'Share', kw: 'share link copy url', icon: 'M10 13a5 5 0 007 0l2-2a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-2 2a5 5 0 007 7l1-1' }
] },
{ group: 'Settings', items: [
{ id: 'theme', label: 'Toggle Theme', hint: 'Appearance', kw: 'theme dark light appearance', icon: 'M12 3a9 9 0 100 18 7 7 0 010-18z' },
{ id: 'keys', label: 'Edit Keyboard Shortcuts', hint: 'Hotkeys', kw: 'keys keyboard shortcuts hotkeys', icon: 'M3 7h18M3 12h18M3 17h18' },
{ id: 'signout', label: 'Sign Out', hint: 'Account', kw: 'sign out logout account', icon: 'M16 17l5-5-5-5M21 12H9M9 21H4V3h5' }
] }
];
var filtered = [];
var active = -1;
function render(q) {
q = (q || '').toLowerCase().trim();
filtered = [];
var html = '';
commands.forEach(function (g) {
var items = g.items.filter(function (it) {
return !q || it.label.toLowerCase().indexOf(q) > -1 || it.kw.indexOf(q) > -1 || it.hint.toLowerCase().indexOf(q) > -1;
});
if (!items.length) return;
html += '<li role="presentation" class="vc-mono px-4 pt-3 pb-1 text-[10px] uppercase tracking-wider text-white/35">' + g.group + '</li>';
items.forEach(function (it) {
var idx = filtered.length;
filtered.push(it);
html +=
'<li role="option" data-idx="' + idx + '" aria-selected="false" tabindex="-1"' +
' class="cmd-item group mx-2 flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-white/75 transition-colors hover:bg-white/[0.06] hover:text-white aria-selected:bg-white/[0.08] aria-selected:text-white">' +
'<span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-white/10 bg-white/[0.04] text-white/60 group-hover:text-white aria-selected:text-white"><svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="' + it.icon + '"/></svg></span>' +
'<span class="min-w-0 flex-1"><span class="block font-g text-[14px] leading-tight">' + it.label + '</span></span>' +
'<span class="vc-mono shrink-0 text-[11px] text-white/35">' + it.hint + '</span>' +
'<span class="vc-mono hidden shrink-0 items-center gap-1 text-[10px] text-[#50e3c2] aria-selected:flex"><svg class="h-3 w-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true"><path d="M5 12l5 5L20 7"/></svg>enter</span>' +
'</li>';
});
});
list.innerHTML = html;
empty.classList.toggle('hidden', filtered.length > 0);
active = filtered.length ? 0 : -1;
setActive();
bindItems();
}
function setActive() {
var items = list.querySelectorAll('.cmd-item');
items.forEach(function (el, i) {
var sel = (i === active);
el.setAttribute('aria-selected', sel ? 'true' : 'false');
});
var el = items[active];
if (el) {
input.setAttribute('aria-activedescendant', el.getAttribute('data-idx'));
el.scrollIntoView({ block: 'nearest' });
} else {
input.removeAttribute('aria-activedescendant');
}
}
function move(step) {
if (!filtered.length) return;
active = (active + step + filtered.length) % filtered.length;
setActive();
}
function runCommand(it) {
showToast('Ran: ' + it.label);
}
function showToast(msg) {
toast.innerHTML = '<span class="vc-dot" style="margin-right:2px"></span>' + msg;
toast.classList.remove('hidden');
toast.classList.add('flex');
clearTimeout(showToast._t);
showToast._t = setTimeout(function () { toast.classList.add('hidden'); toast.classList.remove('flex'); }, 1800);
}
function bindItems() {
list.querySelectorAll('.cmd-item').forEach(function (el, i) {
el.addEventListener('mouseenter', function () { active = i; setActive(); });
el.addEventListener('click', function () { if (filtered[i]) { var it = filtered[i]; close(); runCommand(it); } });
});
}
function open() {
if (!overlay.classList.contains('hidden')) return;
lastFocus = document.activeElement;
overlay.classList.remove('hidden');
overlay.classList.add('flex');
input.value = '';
render('');
requestAnimationFrame(function () { input.focus(); });
}
function close() {
overlay.classList.add('hidden');
overlay.classList.remove('flex');
input.removeAttribute('aria-activedescendant');
if (lastFocus && typeof lastFocus.focus === 'function') lastFocus.focus();
}
function trap(e) {
if (e.key === 'Escape') { e.preventDefault(); close(); return; }
if (e.key === 'ArrowDown') { e.preventDefault(); move(1); return; }
if (e.key === 'ArrowUp') { e.preventDefault(); move(-1); return; }
if (e.key === 'Enter') {
e.preventDefault();
if (filtered[active]) { var it = filtered[active]; close(); runCommand(it); }
return;
}
if (e.key === 'Tab') {
e.preventDefault();
move(e.shiftKey ? -1 : 1);
}
}
openBtn.addEventListener('click', open);
overlay.addEventListener('mousedown', function (e) { if (e.target === overlay) close(); });
input.addEventListener('input', function () { render(input.value); });
overlay.addEventListener('keydown', trap);
document.addEventListener('keydown', function (e) {
if ((e.metaKey || e.ctrlKey) && (e.key === 'k' || e.key === 'K')) {
e.preventDefault();
if (overlay.classList.contains('hidden')) open(); else close();
}
});
render('');
})();
</script>
</div> Agent skill & Model Context Protocol
Pass this section straight into your AI workflow. DevSnips exposes each resource as a structured, addressable registry entry, so your agent installs the real files instead of approximating them.
devsnips://sections/developer/command-palette/vercel I want to use this DevSnips resource in production: Page: https://devsnips.site/library/tailwind/sections/developer/command-palette/vercel/ Install: npx devsnips add Tailwind/Sections/Developer/command-palette/vercel This is the Command Palette — Vercel — Refined dark monochrome Cmd+K command palette with hairline borders, a subtle radial glow, and a single teal accent. Live search filters grouped commands, arrow keys move the highlight, Enter runs the selected command with a confirmation toast, Escape closes, and Cmd/Ctrl+K toggles open. Focus is trapped inside the palette and restored to the trigger on close. Use this DevSnips resource as the starting point for my project. Adapt it to my project's stack and conventions, fix any issues, and make it production-ready while preserving its intended design and behavior.
Paste into ChatGPT, Claude or your agent — it already carries the page URL and the exact install path.
devsnips://sections/developer/command-palette/vercel