macOS JS behaviour

Spotlight

macOS Spotlight: a centred glass panel, grouped results with app icons, arrow-key selection, a preview pane on the side, and ⌘K to summon it.

Real scenarios

The component as it is used in a product — not a specimen grid.

Spotlight

Press ⌘K (or Ctrl+K) or click the magnifier: the desktop dims, results group under headers, ↑/↓ walk the blue row and Enter flashes the hit open — with a live preview beside it.

Important props

Important props
Prop Type Default What it does
panel width '680px' One wide centred panel: a big field, results beneath.
preview pane 'on-select' Selecting a result opens its preview alongside.
groups list 'apps · files · web' Results split under headed groups.

Snippet

<dialog class="mcspot">
    <div class="mcspot-field"><span>🔍</span><input placeholder="جست‌وجوی Spotlight"></div>
    <ul class="mcspot-results" role="listbox">
        <li data-current>🧮 Calculator — Top hit</li>
    </ul>
</dialog>

<style>
.mcspot { inline-size: min(90vw, 680px); border: none; border-radius: 12px; padding: 10px;
          background: #f2f2f2e0; backdrop-filter: blur(40px) saturate(1.5);
          box-shadow: 0 24px 80px #00000045; }
.mcspot-field { display: flex; gap: 10px; align-items: center; block-size: 44px; }
.mcspot-results li[data-current] { background: #007AFF; color: #fff; border-radius: 6px; }
</style>