Command Item

Row for command menus with a label, an optional keyboard shortcut in a kbd tag and an active highlight state. Use it to build custom command lists.

src/registry/ui/command-item.tsx/r/command-item.json

Installation#

bash
npx shadcn@latest add @minidev/command-item

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/command-item.json

Usage#

tsx
import { CommandItem } from "@/components/ui/command-item"

export function Example() {
  return <CommandItem />
}

API reference#

CommandItem props
PropTypeDefault
children*React.ReactNode-
shortcutstring-
activeboolean-
onSelect() => void-
classNamestring-

* required

All navigation components

Learn more