Skip to content

Kbd

Keyboard key and shortcut hint.

Installation

bun add @xerobi/ui
import { Kbd, KbdGroup } from "@xerobi/ui/kbd"

This component is client-side. In Astro, hydrate it with a client directive.

Examples

Default

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

export function KbdDefault() {
  return (
    <KbdGroup>
      <Kbd>Ctrl</Kbd>
      <Kbd>K</Kbd>
    </KbdGroup>
  )
}

API reference

Kbd

Also accepts every prop of <kbd> element.

No props of its own.

KbdGroup

Also accepts every prop of <div> element.

No props of its own.

Styling hooks: [data-slot="kbd"], [data-slot="kbd-group"].

Search documentation

Search pages, components and blocks.