A Raycast & Linear-grade ⌘K Command Palette where command rows roll smoothly across a 3D cylindrical barrel using native CSS view() timelines — works directly on [cmdk-item] with ↑↓ keyboard scrolling and 0 KB scroll JS.
/* 1) Paste once in globals.css — upgrades ANY existing cmdk / shadcn CommandList (0 KB JS)
@keyframes cmd-barrel {
0% { opacity: 0.14; transform: perspective(680px) translateY(14px) rotateX(-54deg) scale(0.84); }
20% { opacity: 0.72; transform: perspective(680px) translateY(3px) rotateX(-22deg) scale(0.95); }
40%, 60% { opacity: 1; transform: perspective(680px) translateY(0) rotateX(0deg) scale(1); }
80% { opacity: 0.72; transform: perspective(680px) translateY(-3px) rotateX(22deg) scale(0.95); }
100% { opacity: 0.14; transform: perspective(680px) translateY(-14px) rotateX(54deg) scale(0.84); }
}
@supports (animation-timeline: view()) {
@media (prefers-reduced-motion: no-preference) {
.cmdk-barrel [cmdk-item],
.cmdk-barrel [cmdk-group-heading] {
animation: cmd-barrel linear both;
animation-timeline: view(block);
animation-range: cover 0% cover 100%;
}
}
}
*/
// 2) Drop-in React + Tailwind + shadcn/ui Command (cmdk) component
'use client'
import { useEffect, useState } from 'react'
import {
CommandDialog, CommandEmpty, CommandGroup, CommandInput,
CommandItem, CommandList, CommandShortcut,
} from '@/components/ui/command'
import { Sparkles, Rocket, Terminal, GitBranch, ShieldCheck, Cloud } from 'lucide-react'
const COMMANDS = [
{ group: 'AI Agents', id: 'copilot', label: 'Ask AI Copilot', kbd: '⌘J', Icon: Sparkles },
{ group: 'AI Agents', id: 'review', label: 'Run AI Security Review', kbd: '⇧R', Icon: ShieldCheck },
{ group: 'Deploy', id: 'preview', label: 'Deploy Preview Branch', kbd: '⇧D', Icon: Rocket },
{ group: 'Deploy', id: 'logs', label: 'Tail Edge Function Logs', kbd: 'G L', Icon: Terminal },
{ group: 'Deploy', id: 'purge', label: 'Purge CDN Tag Cache', kbd: '⇧C', Icon: Cloud },
{ group: 'Workspace', id: 'branch', label: 'Switch Git Branch', kbd: '⌘B', Icon: GitBranch },
]
export function BarrelCommandPalette({ onRun }: { onRun?: (id: string) => void }) {
const [open, setOpen] = useState(false)
useEffect(() => {
const onKeyDown = (e: KeyboardEvent) => {
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
e.preventDefault()
setOpen((v) => !v)
}
}
window.addEventListener('keydown', onKeyDown)
return () => window.removeEventListener('keydown', onKeyDown)
}, [])
return (
<>
<button
type="button"
onClick={() => setOpen(true)}
className="inline-flex items-center gap-2 rounded-xl border border-white/15 bg-[#0f1320] px-3.5 py-2 text-xs font-medium text-slate-200 shadow-lg"
>
<span className="h-2 w-2 rounded-full" style={{ background: '#8b5cf6' }} />
Command Palette
<kbd className="rounded border border-white/15 bg-white/5 px-1.5 py-0.5 font-mono text-[10px]">⌘K</kbd>
</button>
<CommandDialog open={open} onOpenChange={setOpen}>
<CommandInput placeholder="Type a command or search AI actions…" />
<div className="relative h-[280px] overflow-hidden">
{/* Center focal rail */}
<div
aria-hidden="true"
className="pointer-events-none absolute inset-x-3 top-1/2 z-10 h-[52px] -translate-y-1/2 rounded-xl border-y"
style={{ backgroundColor: '#8b5cf616', borderColor: '#38bdf855' }}
/>
<CommandList className="cmdk-barrel h-full max-h-none overflow-y-auto px-3 py-11 [mask-image:linear-gradient(to_bottom,transparent,black_14%,black_86%,transparent)]">
<CommandEmpty>No matching commands.</CommandEmpty>
{['AI Agents', 'Deploy', 'Workspace'].map((group) => (
<CommandGroup key={group} heading={group}>
{COMMANDS.filter((c) => c.group === group).map(({ id, label, kbd, Icon }) => (
<CommandItem
key={id}
onSelect={() => {
onRun?.(id)
setOpen(false)
}}
className="mb-1.5 h-12 rounded-xl border border-white/10 px-3"
>
<Icon className="mr-2.5 size-4" style={{ color: '#38bdf8' }} />
<span>{label}</span>
<CommandShortcut>{kbd}</CommandShortcut>
</CommandItem>
))}
</CommandGroup>
))}
</CommandList>
</div>
</CommandDialog>
</>
)
}Loading single-file HTML…
Build a single-file interactive 3D Barrel Command Palette (⌘K) powered by Pure CSS Scroll-Driven Animations (animation-timeline: view(), Baseline Oct 2026) designed to drop straight into cmdk and shadcn/ui Command on a deep obsidian glass surface (#07090f) with a Light/Dark toggle.
- Pure CSS 3D Barrel Scroll: Apply @supports (animation-timeline: view()) with animation: cmd-barrel linear both and animation-range: cover 0% cover 100% directly to each command row and group heading inside a masked scrollport, tilting entering and exiting rows along perspective(680px) rotateX(-54deg → 0deg → +54deg) with crisp scale and opacity curves around a center focal guide.
- Keyboard-First UX: Support real ↑ / ↓ arrow navigation with smooth scrollIntoView({ block: 'center' }) so keyboard stepping naturally rolls the 3D barrel with zero JS animation math, Enter to execute commands into a live workspace status toast above the palette, live search filtering, scope filter pills, Curve Depth presets (34° / 54° / 72°), and an Auto-Roll preview button.
- Library Drop-In & A11y: Zero external CDN dependencies, clean @supports + prefers-reduced-motion fallback, and a copy-paste React + Tailwind + shadcn/ui Command (cmdk) snippet targeting [cmdk-item] directly.WHY THIS WORKS IN PRODUCTION
- Targets [cmdk-item] & [cmdk-group-heading] directly — 12 lines of CSS upgrades any existing shadcn Command
- Arrow-key ↑↓ navigation scrolls items into center focus, naturally rolling the 3D CSS barrel
- Live command execution toast, fuzzy search, scope filters, 34°/54°/72° curve presets & Auto-Roll
- Baseline Oct 2026 pure CSS view() with automatic @supports & prefers-reduced-motion fallback
DROP-IN SPECS // WEB & MOBILE FIT








