Components
- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Hooks
Kbd
Styled representation of a single key.
K⌘⌃⇧
⌘+K
Installation#
pnpm dlx shadcn@latest add @shark/kbd
Anatomy#
Kbd KbdGroup ├── Kbd └── Kbd
Usage#
import { Kbd, KbdGroup } from "@/components/ui";
<KbdGroup> <Kbd>⌘</Kbd> <Kbd>K</Kbd> </KbdGroup>
Variant#
Outline#
K⌘⌃
Examples#
Group#
Use KbdGroup to group keys into a single shortcut.
Use
Ctrl+K
to open the command paletteInput Group#
Use Kbd inside InputGroup addons to show shortcut hints next to inputs.
⌘K
Button#
Add shortcut hints to buttons with Kbd or KbdGroup.
Tooltip#
Show keyboard shortcuts in Tooltip content.
API Reference#
Kbd#
Styled representation of a single key.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "outline" | "default" |
className | string | - |
asChild | boolean | false |
KbdGroup#
Groups multiple keys into one shortcut.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |