Command

Searchable command palette for quick actions. Supports groups, icons, shortcuts, and dialog mode with ⌘K / Ctrl K.

This component requires softui.js for interactive behavior.

Default

Type to filter the list.

Suggestions
Settings
No results found.
<div class="sui-command" data-sui-command>
  <div class="sui-command-input-wrap">
    <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="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
    <input class="sui-command-input" type="text" placeholder="Type a command or search...">
  </div>
  <div class="sui-command-list">
    <div class="sui-command-group">
      <div class="sui-command-group-label">Suggestions</div>
      <button class="sui-command-item">Calendar</button>
      <button class="sui-command-item">Search Emoji</button>
      <button class="sui-command-item">Calculator</button>
    </div>
    <div class="sui-command-separator"></div>
    <div class="sui-command-group">
      <div class="sui-command-group-label">Settings</div>
      <button class="sui-command-item">Profile <span class="sui-command-shortcut">⌘P</span></button>
      <button class="sui-command-item">Billing <span class="sui-command-shortcut">⌘B</span></button>
      <button class="sui-command-item">Settings <span class="sui-command-shortcut">⌘,</span></button>
    </div>
  </div>
  <div class="sui-command-empty">No results found.</div>
</div>

With Icons

Add SVG icons with sui-command-icon for quick visual scanning.

Actions
Settings
No results found.
<div class="sui-command" data-sui-command>
  <div class="sui-command-input-wrap">
    <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="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
    <input class="sui-command-input" type="text" placeholder="Search commands...">
  </div>
  <div class="sui-command-list">
    <div class="sui-command-group">
      <div class="sui-command-group-label">Actions</div>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> Calendar <span class="sui-command-shortcut">⌘K C</span></button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg> Search Emoji <span class="sui-command-shortcut">⌘K E</span></button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="2" width="16" height="20" rx="2"/><line x1="8" y1="6" x2="16" y2="6"/><line x1="16" y1="14" x2="16" y2="18"/><line x1="8" y1="10" x2="8" y2="10"/><line x1="12" y1="10" x2="12" y2="10"/><line x1="16" y1="10" x2="16" y2="10"/><line x1="8" y1="14" x2="8" y2="14"/><line x1="12" y1="14" x2="12" y2="14"/></svg> Calculator <span class="sui-command-shortcut">⌘K M</span></button>
    </div>
    <div class="sui-command-separator"></div>
    <div class="sui-command-group">
      <div class="sui-command-group-label">Settings</div>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> Profile <span class="sui-command-shortcut">⌘P</span></button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"/><line x1="1" y1="10" x2="23" y2="10"/></svg> Billing <span class="sui-command-shortcut">⌘B</span></button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg> Settings <span class="sui-command-shortcut">⌘,</span></button>
    </div>
  </div>
  <div class="sui-command-empty">No results found.</div>
</div>

Groups

Group items under labels; empty groups hide while filtering.

File
Edit
View
No results found.
<div class="sui-command" data-sui-command>
  <div class="sui-command-input-wrap">
    <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="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
    <input class="sui-command-input" type="text" placeholder="Search...">
  </div>
  <div class="sui-command-list">
    <div class="sui-command-group">
      <div class="sui-command-group-label">File</div>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="12" y1="18" x2="12" y2="12"/><line x1="9" y1="15" x2="15" y2="15"/></svg> New File</button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg> New Folder</button>
    </div>
    <div class="sui-command-separator"></div>
    <div class="sui-command-group">
      <div class="sui-command-group-label">Edit</div>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg> Find</button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg> Find &amp; Replace</button>
    </div>
    <div class="sui-command-separator"></div>
    <div class="sui-command-group">
      <div class="sui-command-group-label">View</div>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="9" y1="21" x2="9" y2="9"/></svg> Toggle Sidebar</button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" y1="10" x2="21" y2="3"/><line x1="3" y1="21" x2="10" y2="14"/></svg> Toggle Fullscreen</button>
      <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg> Zen Mode</button>
    </div>
  </div>
  <div class="sui-command-empty">No results found.</div>
</div>

Empty State

Shown when nothing matches (try "xyz").

No results found.
<div class="sui-command" data-sui-command>
  <div class="sui-command-input-wrap">
    <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="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
    <input class="sui-command-input" type="text" placeholder="Try searching 'xyz'...">
  </div>
  <div class="sui-command-list">
    <div class="sui-command-group">
      <button class="sui-command-item">Apple</button>
      <button class="sui-command-item">Banana</button>
      <button class="sui-command-item">Cherry</button>
      <button class="sui-command-item">Grape</button>
      <button class="sui-command-item">Mango</button>
    </div>
  </div>
  <div class="sui-command-empty">No results found.</div>
</div>

Dialog Mode

Press ⌘K / Ctrl K or click the button to open it as a dialog.

Suggestions
Settings
No results found.
<!-- Trigger button -->
<button class="sui-btn sui-btn-primary" data-sui-command-open="cmd-dialog">Open Command Palette (⌘K / Ctrl K)</button>

<!-- Dialog overlay -->
<div class="sui-command-dialog" id="cmd-dialog" data-sui-command-key="k">
  <div class="sui-command" data-sui-command>
    <div class="sui-command-input-wrap">
      <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="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
      <input class="sui-command-input" type="text" placeholder="Type a command or search...">
    </div>
    <div class="sui-command-list">
      <div class="sui-command-group">
        <div class="sui-command-group-label">Suggestions</div>
        <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> Calendar</button>
        <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg> Search Emoji</button>
        <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="2" width="16" height="20" rx="2"/><line x1="8" y1="6" x2="16" y2="6"/></svg> Calculator</button>
      </div>
      <div class="sui-command-separator"></div>
      <div class="sui-command-group">
        <div class="sui-command-group-label">Settings</div>
        <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> Profile <span class="sui-command-shortcut">⌘P</span></button>
        <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"/><line x1="1" y1="10" x2="23" y2="10"/></svg> Billing <span class="sui-command-shortcut">⌘B</span></button>
        <button class="sui-command-item"><svg class="sui-command-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg> Settings <span class="sui-command-shortcut">⌘,</span></button>
      </div>
    </div>
    <div class="sui-command-empty">No results found.</div>
  </div>
</div>

Disabled Items

Add the disabled class to make an item non-interactive.

Actions
No results found.
<div class="sui-command" data-sui-command>
  <div class="sui-command-input-wrap">
    <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="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
    <input class="sui-command-input" type="text" placeholder="Search actions...">
  </div>
  <div class="sui-command-list">
    <div class="sui-command-group">
      <div class="sui-command-group-label">Actions</div>
      <button class="sui-command-item">New Project</button>
      <button class="sui-command-item disabled">Import From GitHub</button>
      <button class="sui-command-item">Invite Team Member</button>
      <button class="sui-command-item disabled">Deploy to Production</button>
      <button class="sui-command-item">View Analytics</button>
    </div>
  </div>
  <div class="sui-command-empty">No results found.</div>
</div>

Reference

Attribute / Class / KeyDescription
data-sui-commandOn sui-command: enables filtering and keyboard navigation.
data-keywordsOn an item: extra search terms that match even if they are not in its text.
disabledClass on an item: dims it and blocks clicks.
sui-command-emptyShown when no item matches the query.
data-sui-command-openOn a button: opens the dialog whose id it names.
data-sui-command-keyOn sui-command-dialog: the letter pressed with ⌘ or Ctrl to toggle the dialog (default k).
↑ ↓Move the highlight through visible items; wraps at the ends.
EnterRuns the highlighted item.
EscCloses the dialog; clicking the backdrop also closes it.

Delete this item?

This action cannot be undone. This will permanently delete the item and remove all associated data.