Skip to content
UI

Search docs

Search components and documentation

New
Menu

Kbd

Displays a keyboard shortcut or key combination.

Save
S
Command palette
CtrlK

Installation

npx logic2b@latest add kbd

Usage

import { Kbd, KbdGroup } from "@/components/ui/kbd"

<KbdGroup>
  <Kbd>⌘</Kbd>
  <Kbd>K</Kbd>
</KbdGroup>

API

Prop Type Default
className (Kbd / KbdGroup) string

Both render plain elements (Kbd a <kbd>, KbdGroup a <div>) and forward all native attributes. Use KbdGroup to lay out a multi-key combination.

Examples

In a Button

Key Combinations

Use
CtrlShiftP
to open the command palette.
Press
B
then Esc to toggle the sidebar.