# Command · JGuang UI

> Command menu for search and quick actions.

- Page: https://jiguang132.com/systems/jguang-ui/docs/components/base/command
- Based on: shadcn/ui documentation (MIT) @ bc0705384b51252af26dcc65425b216bf5eb063c

> Example `command-demo`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/base/command


## About

The `` component uses the [`cmdk`](https://github.com/dip/cmdk) component by [Dip](https://www.dip.org/).

## Installation


  

**Command**


  

**Manual**


```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```


### Install the following dependencies:


```bash
npm install cmdk
```


### Copy and paste the following code into your project.


[View complete source: components/ui/command.tsx](/r/jguang-ui/base/command.json)


### Update the import paths to match your project setup.


## Usage

```tsx showLineNumbers
import {
  Command,
  CommandDialog,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
  CommandShortcut,
} from "@/components/ui/command"
```

```tsx showLineNumbers
<Command className="max-w-sm rounded-lg border">
  <CommandInput placeholder="Type a command or search..." />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>
    <CommandGroup heading="Suggestions">
      <CommandItem>Calendar</CommandItem>
      <CommandItem>Search Emoji</CommandItem>
      <CommandItem>Calculator</CommandItem>
    </CommandGroup>
    <CommandSeparator />
    <CommandGroup heading="Settings">
      <CommandItem>Profile</CommandItem>
      <CommandItem>Billing</CommandItem>
      <CommandItem>Settings</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>
```

## Composition

Use the following composition to build a `Command`:

```text
Command
├── CommandInput
└── CommandList
    ├── CommandEmpty
    ├── CommandGroup
    │   ├── CommandItem
    │   └── CommandItem
    ├── CommandSeparator
    └── CommandGroup
        ├── CommandItem
        └── CommandItem
```

## Basic

A simple command menu in a dialog.


> Example `command-basic`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/base/command


## Shortcuts


> Example `command-shortcuts`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/base/command


## Groups

A command menu with groups, icons and separators.


> Example `command-groups`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/base/command


## Scrollable

Scrollable command menu with multiple items.


> Example `command-scrollable`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/base/command


## RTL

To enable RTL support in JGuang UI, see the [RTL configuration guide](/systems/jguang-ui/docs/rtl).


> Example `command-rtl`: interactive preview on https://jiguang132.com/systems/jguang-ui/docs/components/base/command


## API Reference

See the [cmdk](https://github.com/dip/cmdk) documentation for more information.

---

Index of all JGuang resources: https://jiguang132.com/llms.txt
