KbdPro
A key chip for shortcuts: ⌘ on a Mac and Ctrl elsewhere from one Mod key, sequences, keycap, flat and inline styles and a pressed state.
oxyn add kbdThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- A key chip for shortcuts: ⌘ on a Mac and Ctrl elsewhere from one Mod key, sequences, keycap, flat and inline styles and a pressed state.
When not to use
- A small label for one control: use Tooltip instead.
- Actions and choices behind any trigger: use Dropdown Menu instead.
- The empty state of an AI app: use Starter prompts instead.
Installation
Kbd is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add kbdUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Keycap
Raised keycaps.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Other
Ctrl on Windows and Linux.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Sequence
A two-key sequence.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Flat
Flat style.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Kbd
| Prop | Type | Default | Description |
|---|---|---|---|
keysrequired | String | — | Shortcut ("Mod+Shift+K"). |
other | bool | Default::default() | Non-Mac glyphs. |
style | String | "keycap" | `keycap` · `flat` · `inline`. |
pressed | bool | Default::default() | The keys are held right now. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| — | Not focusable |
Accessibility
- Spelled out for screen readers ("Command K").
- Shortcuts are also exposed as aria-keyshortcuts on the control they belong to.
Responsive behaviour
- inline style sits in running text without changing line height.
Notes for AI
- Import
Kbdfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
KbdElinoxyn_gpui. - Props to set first:
keys. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.