# V command 2

> Simple Command

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

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-command-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-command-2-light-8d087561ff954682.png
- Registry item: https://ui.cnippet.dev/r/v-command-2.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-2.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-2.tsx`

```tsx
"use client";

import { CreditCardIcon, SettingsIcon, UserIcon } from "lucide-react";
import { useState } from "react";
import { Button } from "@/registry/default/ui/button";
import {
  Command,
  CommandDialog,
  CommandDialogPopup,
  CommandDialogTrigger,
  CommandGroup,
  CommandItem,
  CommandList,
  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" />}>
        Simple Command
      </CommandDialogTrigger>
      <CommandDialogPopup className="max-w-xs">
        <Command>
          <CommandList>
            <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>
  );
}
```
