Home / Function/ CommandWithGroups() — ui Function Reference

CommandWithGroups() — ui Function Reference

Architecture documentation for the CommandWithGroups() function in command-groups.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  9e1577ff_7580_8f5b_ef10_9e1765fa9efa["CommandWithGroups()"]
  b1d09b32_1ea9_fcff_c7ca_dcf315c04054["command-groups.tsx"]
  9e1577ff_7580_8f5b_ef10_9e1765fa9efa -->|defined in| b1d09b32_1ea9_fcff_c7ca_dcf315c04054
  style 9e1577ff_7580_8f5b_ef10_9e1765fa9efa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/command-groups.tsx lines 25–75

export function CommandWithGroups() {
  const [open, setOpen] = React.useState(false)

  return (
    <div className="flex flex-col gap-4">
      <Button onClick={() => setOpen(true)} variant="outline" className="w-fit">
        Open Menu
      </Button>
      <CommandDialog open={open} onOpenChange={setOpen}>
        <Command>
          <CommandInput placeholder="Type a command or search..." />
          <CommandList>
            <CommandEmpty>No results found.</CommandEmpty>
            <CommandGroup heading="Suggestions">
              <CommandItem>
                <CalendarIcon />
                <span>Calendar</span>
              </CommandItem>
              <CommandItem>
                <SmileIcon />
                <span>Search Emoji</span>
              </CommandItem>
              <CommandItem>
                <CalculatorIcon />
                <span>Calculator</span>
              </CommandItem>
            </CommandGroup>
            <CommandSeparator />
            <CommandGroup heading="Settings">
              <CommandItem>
                <UserIcon />
                <span>Profile</span>
                <CommandShortcut>⌘P</CommandShortcut>
              </CommandItem>
              <CommandItem>
                <CreditCardIcon />
                <span>Billing</span>
                <CommandShortcut>⌘B</CommandShortcut>
              </CommandItem>
              <CommandItem>
                <SettingsIcon />
                <span>Settings</span>
                <CommandShortcut>⌘S</CommandShortcut>
              </CommandItem>
            </CommandGroup>
          </CommandList>
        </Command>
      </CommandDialog>
    </div>
  )
}

Subdomains

Frequently Asked Questions

What does CommandWithGroups() do?
CommandWithGroups() is a function in the ui codebase, defined in apps/v4/examples/base/command-groups.tsx.
Where is CommandWithGroups() defined?
CommandWithGroups() is defined in apps/v4/examples/base/command-groups.tsx at line 25.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free