Menu

Kbd

Keyboard shortcut. 2 styles × 2 sizes.

Press ⌘ K to search the menu.

Installation

$ npx uix-ui@latest add kbd

This copies the file into components/ui/kbd.tsx in your project. npx shadcn@latest add @uix/kbd works too.

Usage

kbd.tsx
import { Kbd } from "@/components/ui/kbd";

<span className="text-body-medium text-fg-secondary">
  Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to search the menu.
</span>

Props

PropTypeDefaultDescription
appearancedefault | ghost"default"
sizesm | md"md"

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close