TwitterGithub

Command

Fast, composable, command menu for Angular.


About

The command primitive is built upon the incredible work of ng-neat/cmdk.

Installation

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

Usage

import { BrnCommandImports } from '@spartan-ng/ui-command-brain';
import { HlmCommandImports } from '@spartan-ng/ui-command-helm';
<brn-cmd class="w-96" hlm>
  <hlm-cmd-input-wrapper>
    <hlm-icon name="radixMagnifyingGlass" />
    <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="radixCalendar" 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="radixGear" 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