Skip to content

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 kbd
to open the command palette
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

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.

Terminal
oxyn add kbd

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Keycap

Raised keycaps.

to open the command palette
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Other

Ctrl on Windows and Linux.

to open the command palette
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Sequence

A two-key sequence.

to open the command palette
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Flat

Flat style.

to open the command palette
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

Kbd

PropTypeDefaultDescription
keysrequiredString—Shortcut ("Mod+Shift+K").
otherboolDefault::default()Non-Mac glyphs.
styleString"keycap"`keycap` · `flat` · `inline`.
pressedboolDefault::default()The keys are held right now.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
—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 Kbd from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: KbdEl in oxyn_gpui.
  • Props to set first: keys.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI