Home / Function/ CommandItem() — ui Function Reference

CommandItem() — ui Function Reference

Architecture documentation for the CommandItem() function in command.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  852ca3bc_af85_f983_66c6_f736d20d84cf["CommandItem()"]
  10857045_23ce_0bc6_2bea_40b3b73a8c34["command.tsx"]
  852ca3bc_af85_f983_66c6_f736d20d84cf -->|defined in| 10857045_23ce_0bc6_2bea_40b3b73a8c34
  style 852ca3bc_af85_f983_66c6_f736d20d84cf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/ui-rtl/command.tsx lines 146–164

function CommandItem({
  className,
  children,
  ...props
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
  return (
    <CommandPrimitive.Item
      data-slot="command-item"
      className={cn(
        "data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
        className
      )}
      {...props}
    >
      {children}
      <CheckIcon className="ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
    </CommandPrimitive.Item>
  )
}

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free