Skip to main content

Starwind UI v3.0 is now available! Migration guide

Press Ctrl to continue

Installation

Usage

---
import { Kbd } from "@/components/starwind/kbd";
---
<div class="flex items-center gap-2">
<span class="text-sm text-muted-foreground">Press</span>
<Kbd>Ctrl</Kbd>
<span class="text-sm text-muted-foreground">to continue</span>
</div>

Composition

Use KbdGroup when a shortcut contains more than one key:

KbdGroup
├── Kbd
└── Kbd

Basic

Ctrl Shift Alt ⌘ ⏎ Esc

Group

Use the KbdGroup component to group keyboard keys together.

Use

Ctrl + K

to open the command palette

Press

⌘ + Shift + P

to open command palette

With Button

Use the Kbd component inside a Button component to display a keyboard key inside a button.

Common Shortcuts

Copy Ctrl + C
Paste Ctrl + V
Cut Ctrl + X
Undo Ctrl + Z

Arrow Keys

↑
← ↓ →

Use arrow keys to navigate

API Reference

Changelog

View version history v1.1.2 5 releases

v1.1.2

  • In Astro, an attribute that you set on Kbd and KbdGroup now wins over the component’s own default for the same attribute, such as role or aria-label.

v1.1.1

  • The default export in index.ts now has a name, KbdParts, so framework tools show a clear name.

v1.1.0

  • The component is now available for React as well as Astro. Its props and styles stay the same.

v1.0.2

  • The Tailwind variants now live in their own variants.ts file in the component folder.

v1.0.0

  • Initial release with starwind v1.11.0