Skip to content
Drivn logoDrivn

Kbd

Keyboard key component for displaying shortcuts and hotkeys.

Preview

ShiftK

Installation

npx drivn add kbd

Usage

1import { Kbd } from "@/components/ui/kbd"
2
3export default function Page() {
4 return (
5 <Kbd>Shift</Kbd>
6 )
7}

Variants

ShiftShift

Inline Text

Press K to open the search dialog.

Keyboard Shortcuts

CVCtrlShiftPB

API Reference

Kbd

PropTypeDefaultDescription
variant"default" | "outline""default"Visual style of the key
classNamestringAdditional CSS classes to apply
childrenReactNodeKey label displayed inside the element

Kbd.Group

PropTypeDefaultDescription
classNamestringAdditional CSS classes to apply
childrenReactNodeKbd elements to display as a group