Keyboard Key
A Keyboard Key renders a key or a shortcut the way a keyboard shows it, so instructions can name a key without quoting it as prose. It is the small styled block you see in a shortcut list, a tooltip or an empty state that suggests a command.
Rendered live, with the same build of the library you install.
⌘Kopens the search, andEsccloses it.
KeyboardKey.tsx
import { NKbd } from '@nayan-ui/react';const KeyboardKey = () => {return (<div><div className="flex flex-wrap items-center gap-2 text-sm text-muted"><NKbd>⌘</NKbd><NKbd>K</NKbd><span>opens the search, and</span><NKbd>Esc</NKbd><span>closes it.</span></div></div>);};export default KeyboardKey;
| Name | Type | Default | Details |
|---|---|---|---|
| children | ReactNode | Required | The children prop. |
| className | string | '' | The className prop. |
Other components solving nearby problems.