Skip to Content

Kbd

A keyboard key, or a sequence of keys.

⌘K
import { Kbd } from "@dapplelight/signet-ui/components/kbd"

export function Demo() {
  return <Kbd>⌘K</Kbd>
}

Installation

npm i @dapplelight/signet-ui

Usage

import { Kbd, KeySequence } from "@dapplelight/signet-ui/components/kbd"

<Kbd>⌘K</Kbd>

Examples

Sequence

⌘⇧PGI
import { KeySequence } from "@dapplelight/signet-ui/components/kbd"

export function Demo() {
  return (
    <div className="flex flex-col gap-3">
      <KeySequence keys={["⌘", "⇧", "P"]} />
      <KeySequence keys={["G", "I"]} />
    </div>
  )
}

Inline

Press / to search invoices, or CtrlEnter to send.

import { Kbd, KeySequence } from "@dapplelight/signet-ui/components/kbd"

export function Demo() {
  return (
    <p className="text-sm">
      Press <Kbd>/</Kbd> to search invoices, or <KeySequence keys={["Ctrl", "Enter"]} /> to send.
    </p>
  )
}

API Reference

Kbd

PropTypeDefaultDescription
childrenReactNodenoneThe key label.
classNamestringnoneMerged last.

KeySequence

PropTypeDefaultDescription
keysstring | string[]requiredOne key per entry, each in its own Kbd.
classNamestringnoneMerged onto the wrapper.