← Prompt Lab

3D Drum Icon & Reaction Picker

Pure CSS Scroll-Driven 3D Popover for shadcn/ui, Lucide & Reactions
SaaS & AI · Scroll 3D1.1 KB CSS0 copies
SHARE
07 / PLAYGROUND3D Drum Icon & Reaction Picker
BRAND COLORS
Fullscreen ↗

A tactile ceramic-glass Icon & Reaction Picker where rows roll smoothly over a 3D cylindrical drum using native CSS Scroll-Driven Animations (Baseline Oct 2026) — zero JS scroll listeners, drop-in ready for shadcn/ui Popover, Lucide icons, and reaction bars.

CSS Scroll 3DZero Scroll JSshadcn/ui ReadyBaseline 2026
/* 1) Paste once in globals.css (works with shadcn/ui Popover, frimousse, cmdk, Tailwind v4)
@keyframes drum-curve {
  0%   { opacity: 0.14; transform: perspective(620px) translateY(16px) rotateX(-58deg) scale(0.78); }
  20%  { opacity: 0.78; transform: perspective(620px) translateY(3px) rotateX(-22deg) scale(0.94); }
  40%, 60% { opacity: 1; transform: perspective(620px) translateY(0) rotateX(0deg) scale(1); }
  80%  { opacity: 0.78; transform: perspective(620px) translateY(-3px) rotateX(22deg) scale(0.94); }
  100% { opacity: 0.14; transform: perspective(620px) translateY(-16px) rotateX(58deg) scale(0.78); }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .drum-row {
      animation: drum-curve linear both;
      animation-timeline: view(block);
      animation-range: cover 0% cover 100%;
    }
  }
}
*/

// 2) Drop-in React + Tailwind + shadcn/ui Popover component (0 KB scroll JS)
'use client'
import { useMemo, useState } from 'react'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import {
  Sparkles, Zap, Rocket, Flame, Layers, Sliders, Terminal,
  Cpu, ShieldCheck, Compass, Palette, Bot, Globe, Star, Heart,
} from 'lucide-react'

const ICONS = [
  { id: 'sparkles', label: 'Sparkles', Icon: Sparkles },
  { id: 'zap', label: 'Zap', Icon: Zap },
  { id: 'rocket', label: 'Rocket', Icon: Rocket },
  { id: 'flame', label: 'Flame', Icon: Flame },
  { id: 'layers', label: 'Layers', Icon: Layers },
  { id: 'sliders', label: 'Sliders', Icon: Sliders },
  { id: 'terminal', label: 'Terminal', Icon: Terminal },
  { id: 'cpu', label: 'Cpu', Icon: Cpu },
  { id: 'shield', label: 'Shield', Icon: ShieldCheck },
  { id: 'compass', label: 'Compass', Icon: Compass },
  { id: 'palette', label: 'Palette', Icon: Palette },
  { id: 'bot', label: 'Bot', Icon: Bot },
  { id: 'globe', label: 'Globe', Icon: Globe },
  { id: 'star', label: 'Star', Icon: Star },
  { id: 'heart', label: 'Heart', Icon: Heart },
]

export function CurvedIconPicker({ onSelect }: { onSelect?: (id: string) => void }) {
  const [query, setQuery] = useState('')
  const [selected, setSelected] = useState('sparkles')

  const rows = useMemo(() => {
    const q = query.trim().toLowerCase()
    const list = q ? ICONS.filter((i) => i.label.toLowerCase().includes(q)) : ICONS
    const chunks: (typeof ICONS)[] = []
    for (let i = 0; i < list.length; i += 5) chunks.push(list.slice(i, i + 5))
    return chunks
  }, [query])

  return (
    <Popover>
      <PopoverTrigger asChild>
        <button
          type="button"
          className="inline-flex items-center gap-2 rounded-xl border border-zinc-200 bg-white px-3.5 py-2 text-xs font-semibold text-zinc-900 shadow-sm dark:border-white/10 dark:bg-zinc-900 dark:text-white"
        >
          <span className="h-2 w-2 rounded-full" style={{ background: '#4f46e5' }} />
          Pick Icon · {selected}
        </button>
      </PopoverTrigger>

      <PopoverContent className="w-[380px] overflow-hidden rounded-2xl border p-0 shadow-2xl">
        <div className="border-b p-2.5">
          <input
            value={query}
            onChange={(e) => setQuery(e.target.value)}
            placeholder="Filter icons…"
            className="w-full rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-1.5 text-xs outline-none focus:border-indigo-500 dark:border-white/10 dark:bg-zinc-900"
          />
        </div>

        <div className="relative h-[260px] overflow-hidden">
          {/* Center focal lens band */}
          <div
            aria-hidden="true"
            className="pointer-events-none absolute inset-x-3 top-1/2 z-10 h-[72px] -translate-y-1/2 rounded-xl border-y"
            style={{
              backgroundColor: '#4f46e50f',
              borderColor: '#06b6d444',
            }}
          />

          {/* Pure CSS 3D cylindrical scrollport */}
          <div className="h-full overflow-y-auto px-3.5 py-10 [mask-image:linear-gradient(to_bottom,transparent,black_14%,black_86%,transparent)]">
            {rows.map((row, rIdx) => (
              <div key={rIdx} className="drum-row mb-2 grid grid-cols-5 gap-2">
                {row.map(({ id, label, Icon }) => (
                  <button
                    key={id}
                    type="button"
                    onClick={() => {
                      setSelected(id)
                      onSelect?.(id)
                    }}
                    style={selected === id ? { borderColor: '#4f46e5' } : undefined}
                    className="flex h-14 flex-col items-center justify-center gap-1 rounded-xl border border-zinc-200/80 bg-zinc-50 text-zinc-800 transition-transform hover:-translate-y-0.5 hover:scale-105 dark:border-white/10 dark:bg-white/5 dark:text-zinc-100"
                  >
                    <Icon className="size-4" />
                    <span className="text-[9px] font-mono text-zinc-500">{label}</span>
                  </button>
                ))}
              </div>
            ))}
          </div>
        </div>
      </PopoverContent>
    </Popover>
  )
}

WHY THIS WORKS IN PRODUCTION

  • 100% Pure CSS animation-timeline: view() — 0 KB JS for 3D scroll physics (120fps compositor)
  • Dual-mode utility: switches cleanly between crisp Lucide-style UI icons & tactile reaction tiles
  • Live workspace reaction bar + instant search + Curve Depth (Subtle / Studio / Deep 3D) & Light/Dark switch
  • Drop-in Tailwind v4 CSS utility + shadcn/ui Popover React TSX with automatic @supports fallback

DROP-IN SPECS // WEB & MOBILE FIT

UI SLOTScroll & 3D CSS
BEST USE CASEWorkspace Reaction Pickers, Icon Selectors, shadcn/ui Popovers & Command Menus
IDEAL PLACEMENTComment Composer, Notion/Linear Block Toolbar & Icon Picker Modal
BUNDLE SIZE1.1 KB CSS
DEPENDENCIESZero (CSS view() · shadcn/Tailwind ready)
MOBILE / TOUCHNative Momentum Scroll
GPU WEIGHTLight · 60fps