Documentation
¶
Overview ¶
Package kbd renders single keystrokes and chords as terminal-styled keycap glyphs. It is the atom that turns "ctrl+k" into a readable ⌃ K inside hint rows, command palettes, and modals.
The package is stateless: there is no Model, no Update, no message. Callers invoke Render, Chord, or Sequence from inside their own View and place the resulting string wherever a keycap belongs. Colors flow from the shared theme so the atom drops into any parent surface without coordination.
Index ¶
Constants ¶
const ChordSeparator = " + "
ChordSeparator is placed between caps inside a single chord.
const SequenceSeparator = " , "
SequenceSeparator is placed between chords in a keystroke series like "g g" or "Ctrl+K then P".
Variables ¶
This section is empty.
Functions ¶
func Chord ¶
Chord renders a sequence of keys joined with ChordSeparator. Empty keys are skipped. Returns "" when no usable keys are passed.
func Render ¶
Render formats a single key as a styled keycap using the default theme. Returns "" when key is empty.
func RenderStyled ¶
RenderStyled formats a single key with explicit style overrides. Any zero-value field in s falls back to the default theme palette.
