Back to Shark UI

Kbd

docs/components/kbd

latest6.1 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Kbd

Copy Markdown

Styled representation of a single key.

PreviewCode

K⌘⌃⇧

⌘+K

Installation#

CLIManual

pnpmbunnpmyarn

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#

PreviewCode

K⌘⌃

Examples#

Group#

Use KbdGroup to group keys into a single shortcut.

PreviewCode

Use Ctrl+K to open the command palette

Input Group#

Use Kbd inside InputGroup addons to show shortcut hints next to inputs.

PreviewCode

⌘K

Button#

Add shortcut hints to buttons with Kbd or KbdGroup.

PreviewCode

Save Ctrl+S

Tooltip#

Show keyboard shortcuts in Tooltip content.

PreviewCode

Dark mode

API Reference#

Kbd#

Styled representation of a single key.

PropTypeDefault
variant`"default""outline"`
classNamestring-
asChildbooleanfalse

KbdGroup#

Groups multiple keys into one shortcut.

PropTypeDefault
classNamestring-
asChildbooleanfalse

[

Previous page

Item ](/docs/components/item)[

Next page

Link Overlay ](/docs/components/link-overlay)

On This Page

InstallationAnatomyUsageVariantOutlineExamplesGroupInput GroupButtonTooltipAPI ReferenceKbdKbdGroup