TwitterGithub

Command

Fast, composable, command menu for Angular.


About

The command primitive is built upon the incredible work of ngxpert/cmdk .

Installation

npx nx g @spartan-ng/cli:ui command

Usage

import { BrnCommandImports } from '@spartan-ng/brain/command';
import { HlmCommandImports } from '@spartan-ng/ui-command-helm';
<brn-cmd class="w-96" hlm>
  <hlm-cmd-input-wrapper>
    <hlm-icon name="lucideSearch" />
    <input placeholder="Type a command or search..." brnCmdInput hlm />
  </hlm-cmd-input-wrapper>
  <div *brnCmdEmpty hlmCmdEmpty>No results found.</div>
  <brn-cmd-list hlm>
    <brn-cmd-group hlm label="Suggestions">
      <button brnCmdItem hlm>
        <hlm-icon name="lucideCalendar" hlmCmdIcon />
        Calendar
      </button>
    </brn-cmd-group>
    <brn-cmd-separator hlm></brn-cmd-separator>
    <brn-cmd-group hlm label="Settings">
      <button brnCmdItem hlm>
        <hlm-icon name="lucideCog" hlmCmdIcon />
        Settings
        <hlm-cmd-shortcut>S</hlm-cmd-shortcut>
      </button>
    </brn-cmd-group>
  </brn-cmd-list>
</brn-cmd>

Examples

Dialog

Press ⌘ + K

Last command: none

Combobox

You can use the brn-command component as a combobox. See the Combobox page for more information.

Context Menu Combobox