Skip to content

Shortcuts Panel ​

The keyboard-shortcuts reference sheet: an elevated 264px panel with a titled header and close button, then titled sections of label + key-chip rows. Long lists scroll inside the body.

Examples ​

Three sections ​

moonbit
@sumi.shortcuts_panel(
  sections=[
    @sumi.ShortcutSection::new("General", [
      @sumi.ShortcutItem::new("Toggle sidebar", "Cmd /"),
      @sumi.ShortcutItem::new("Send message", "Enter"),
    ]),
    @sumi.ShortcutSection::new("Editing", [
      @sumi.ShortcutItem::new("Select all", "⌘ A"),
      @sumi.ShortcutItem::new("Undo", "⌘ Z"),
    ]),
  ],
  on_close=close_panel,
)

API ​

shortcuts_panel ​

NameTypeDefaultDescription
sections *Array[ShortcutSection]—Titled shortcut clusters
titleString"Shortcuts"Header text (defaults to "Shortcuts")
on_closeCmd—Close button command; omit to hide the button's action
widthInt264Panel width in px (default 264)
max_heightInt660Panel max height in px (default 660)
idString—Element id
classString—Extra class names
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

ShortcutSection::new ​

A titled cluster.

NameTypeDefaultDescription
titleString—Native tooltip title
itemsArray[ShortcutItem]—

ShortcutItem::new ​

One row.

NameTypeDefaultDescription
labelString—
keysString—

* required (labelled) parameter — everything else is optional.