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
  1f2c88de_b23d_ee96_38c9_4538ade8c18e["CommandItem()"]
  3bbe14d1_264d_de37_24d9_abecee38854b["command.tsx"]
  1f2c88de_b23d_ee96_38c9_4538ade8c18e -->|defined in| 3bbe14d1_264d_de37_24d9_abecee38854b
  style 1f2c88de_b23d_ee96_38c9_4538ade8c18e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/ui-rtl/command.tsx lines 148–166

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/radix/ui-rtl/command.tsx.
Where is CommandItem() defined?
CommandItem() is defined in apps/v4/examples/radix/ui-rtl/command.tsx at line 148.

Analyze Your Own Codebase

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

Try Supermodel Free