# V command 3

> Command With Groups

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-command-3).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-command-3
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-command-3-light-96eec460ddf9b8d5.png
- Registry item: https://ui.cnippet.dev/r/v-command-3.json
- Categories: command
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-command-3.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/command`

## Files

### `registry/default/variants/v-command-3.tsx`

```tsx
"use client";

import {
  CalculatorIcon,
  CalendarIcon,
  CreditCardIcon,
  SettingsIcon,
  SmileIcon,
  UserIcon,
} from "lucide-react";
import { useState } from "react";
import { Button } from "@/registry/default/ui/button";
import {
  Command,
  CommandDialog,
  CommandDialogPopup,
  CommandDialogTrigger,
  CommandGroup,
  CommandItem,
  CommandList,
  CommandSeparator,
  CommandShortcut,
} from "@/registry/default/ui/command";

export default function Component() {
  const [open, setOpen] = useState(false);

  return (
    <CommandDialog onOpenChange={setOpen} open={open}>
      <CommandDialogTrigger render={<Button variant="outline" />}>
        Open Command
      </CommandDialogTrigger>
      <CommandDialogPopup className="max-w-sm">
        <Command>
          <CommandList>
            <CommandGroup>
              <CommandItem className="gap-2">
                <CalendarIcon className="size-4 shrink-0" />
                <span>Calendar</span>
              </CommandItem>
              <CommandItem className="gap-2">
                <SmileIcon className="size-4 shrink-0" />
                <span>Search Emoji</span>
              </CommandItem>
              <CommandItem className="gap-2">
                <CalculatorIcon className="size-4 shrink-0" />
                <span>Calculator</span>
              </CommandItem>
            </CommandGroup>
            <CommandSeparator />
            <CommandGroup>
              <CommandItem className="gap-2">
                <UserIcon className="size-4 shrink-0" />
                <span>Profile</span>
                <CommandShortcut>⌘P</CommandShortcut>
              </CommandItem>
              <CommandItem className="gap-2">
                <CreditCardIcon className="size-4 shrink-0" />
                <span>Billing</span>
                <CommandShortcut>⌘B</CommandShortcut>
              </CommandItem>
              <CommandItem className="gap-2">
                <SettingsIcon className="size-4 shrink-0" />
                <span>Settings</span>
                <CommandShortcut>⌘S</CommandShortcut>
              </CommandItem>
            </CommandGroup>
          </CommandList>
        </Command>
      </CommandDialogPopup>
    </CommandDialog>
  );
}
```
