# Command: Basic

> Typing filters and ranks items as you go. Groups with no matches disappear, and the list height animates to fit what is left.

Example: https://hextaui.com/docs/command/examples/basic
Component docs: https://hextaui.com/docs/command.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/command-basic.json
```

This adds `components/examples/command/basic.tsx` with the Command component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/command/basic.tsx"
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
} from "@/components/ui/command"

export function CommandBasic() {
  return (
    <Command className="w-full max-w-sm">
      <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>
  )
}
```

## Props in this example

### CommandInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `placeholder` | `string` | – |  |

### CommandGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `ReactNode` | – |  |

## More Command examples

- [Dialog](https://hextaui.com/docs/command/examples/dialog.md)
- [Pages](https://hextaui.com/docs/command/examples/pages.md)
- [Scrollable](https://hextaui.com/docs/command/examples/scrollable.md)
- [Async results](https://hextaui.com/docs/command/examples/async.md)
- [Long content](https://hextaui.com/docs/command/examples/long-content.md)
- [Right to left](https://hextaui.com/docs/command/examples/rtl.md)
