StellarUI

<stellar-hotkey>

Platform-aware keyboard shortcut formatter for menus, docs, and inline hint text.

Properties

Preview

Press to open search.

Use a single space-separated shortcut string with tokens like $mod, $alt, $shift, $enter, and arrow names. Mac hides the default delimiter; other platforms use +.

Markup

Copy
<stellar-hotkey keys="$mod K"></stellar-hotkey>

API

Complete props, events, slots, and implementation notes for the shipped hotkey formatter.

Props

PropTypeDefaultNotes
keysstring''Shortcut text as one space-separated string. Use tokens like $mod, $alt, $shift, $enter, and arrow names instead of writing delimiter characters.
labelstring''Optional accessible label. When unset, the rendered shortcut text becomes the host aria-label.
platform'auto' | 'mac' | 'windows' | 'linux''auto'Uses the detected platform by default, or forces a specific platform rendering for docs and mixed-platform references.
appearance'normal' | 'unstyled''normal'unstyled removes the keycap styling so the shortcut can sit inline with surrounding text.

Events

EventSourceNotes
custom eventsnonestellar-hotkey is display-only and does not listen for or emit keyboard events.

Slots

SlotNotes
noneThe shortcut text is fully prop-driven. Author it entirely through the keys string.

Notes

  • The public tag is `stellar-hotkey`, and it is display-only. It formats shortcut text but does not handle keyboard input.
  • Author one space-separated shortcut string in `keys`, using abstract tokens like `$mod` and `$alt` when the visible modifier should adapt by platform.
  • Keyword tokens like `$mod`, `$alt`, `$shift`, `$enter`, and arrow names map to platform-specific symbols or labels before rendering.
  • `appearance='unstyled'` keeps the same parsing and accessibility behavior while dropping the keycap chrome for inline prose.