Skip to content

Keybinding hint

A muted hint that pairs an action with its shortcut, for footers and empty states.

ui.keybinding_hint · Category: Feedback · Full reference →

Keybinding hintKeybinding hint
  • In empty editors and footers, to teach the shortcuts of the most useful actions.
import pyzed as pz
from pyzed import ui
pz.column([
ui.keybinding_hint("Open file", "ctrl-p"),
ui.keybinding_hint("Command palette", "ctrl-shift-p"),
ui.keybinding_hint("Toggle terminal", "ctrl-j"),
], spacing=10, align="center")
Keybinding hint: One keyKeybinding hint: One key
One key
Code
ui.keybinding_hint("Search", "/")
Keybinding hint: CombinationKeybinding hint: Combination
Combination
Code
ui.keybinding_hint("Command palette", "ctrl-shift-p")
Keybinding hint: ChordKeybinding hint: Chord
Chord
Code
ui.keybinding_hint("Keyboard shortcuts", "ctrl-k ctrl-s")

Keybinding hint has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.

keybinding_hint(text, keys, *, theme=None)

A muted hint like “Open file Ctrl P” for footers and empty states.

Property Default Description
text required Text.
keys required Shortcut shown at the end, written as a string: "ctrl-s", "cmd-k cmd-s".
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →