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
  f5718c8b_96a4_0d97_65c1_1cd357ef3d09["CommandWithGroups()"]
  0d2f327c_b552_7957_eedc_5cd4abfbe3d2["command-groups.tsx"]
  f5718c8b_96a4_0d97_65c1_1cd357ef3d09 -->|defined in| 0d2f327c_b552_7957_eedc_5cd4abfbe3d2
  style f5718c8b_96a4_0d97_65c1_1cd357ef3d09 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/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/radix/command-groups.tsx.
Where is CommandWithGroups() defined?
CommandWithGroups() is defined in apps/v4/examples/radix/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