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

Relationship Graph

Source Code

apps/v4/examples/radix/ui/command.tsx lines 145–163

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

Analyze Your Own Codebase

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

Try Supermodel Free