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-uiUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | none | The key label. |
className | string | none | Merged last. |
KeySequence
| Prop | Type | Default | Description |
|---|---|---|---|
keys | string | string[] | required | One key per entry, each in its own Kbd. |
className | string | none | Merged onto the wrapper. |