Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Keyboard conventions

tuile follows Textual’s keyboard patterns across every widget. Learn them once and they work everywhere.

Global and focus movement

KeyAction
TabMove focus to the next widget in the focus ring
Shift-TabMove focus to the previous widget

Focus is managed by your app through Focus<Id>. Call focus.handle_key(key) to route Tab and Shift-Tab, or implement your own ring. The widgets themselves do not trap Tab.

Activation

KeyAction
EnterActivate (buttons, list rows, select options, dialogs, tabs)
SpaceActivate (buttons, list rows) or toggle (checkboxes, switches, table selection)

The helper is_activate(key) recognizes both. Buttons flash for 120 ms on activation. Lists and selects mark state.activated with the chosen index.

Lists and menus

KeyAction
Up / DownMove cursor up or down one row
j / kMove cursor down or up (vim-style, in ListView and OptionList)
HomeJump to the first row
EndJump to the last row
PageUpMove up ten rows (five rows in CommandPalette)
PageDownMove down ten rows (five rows in CommandPalette)
Type-aheadType letters to jump to the next matching entry

Type-ahead resets after a second of inactivity. In ListView it is fuzzy; in Select and CommandPalette it matches prefixes.

OptionList has a special value-cycling mode: Left/Right, h/l or Space adjusts the value at the cursor (cycles choices, toggles bools, steps numbers) and reports it through take_changed. Enter never cycles: it reports the row through take_activated, which is how an app opens a dropdown, a text field, or runs a command for the row the cursor is on. A Text or Action row has nothing to cycle and only ever activates.

Text fields

Single-line Input and multi-line TextArea share the same motion and editing keys.

KeyAction
Left / RightMove cursor one grapheme
Ctrl-Left / Ctrl-RightMove to previous or next word boundary
HomeMove to start of line (or start of document with Ctrl in TextArea)
EndMove to end of line (or end of document with Ctrl in TextArea)
Up / DownMove up or down one line (TextArea only)
PageUp / PageDownMove up or down ten lines (TextArea only)

Word boundaries follow the rule in core::word_boundary: skip non-alphanumerics, then the word itself. Both widgets use the same function so they cannot drift.

Editing

KeyAction
BackspaceDelete backward (by word with Ctrl in Input)
DeleteDelete forward
TabAccept suggestion (Input) or insert four spaces (TextArea)

Input shows a greyed-out suggestion from its suggester hook; Tab or Right at the end accepts it. TextArea has no autocomplete; Tab is indent.

Clipboard and undo

KeyAction
Ctrl-ASelect all
Ctrl-CCopy selection
Ctrl-XCut selection
Ctrl-VPaste
Ctrl-ZUndo
Ctrl-YRedo (TextArea only)

The clipboard is per-widget state, not the system clipboard. Input also supports emacs-style shortcuts: Ctrl-U deletes from cursor to start, Ctrl-K deletes to end, Ctrl-W deletes the word before the cursor, and Alt-B / Alt-F move by word.

TextArea adds Ctrl-D to duplicate the current line and Alt-Up / Alt-Down to move the line up or down.

KeyAction
EscapeClose the dropdown, dialog, or palette

Select and MultiSelect open on Enter, Space, or Down when closed. Modal closes on Escape only if close_on_escape is true (the default). CommandPalette always closes on Escape.

Click outside a dropdown or modal backdrop to dismiss (when close_on_backdrop is enabled).

Tables

KeyAction
ArrowsMove cursor (row or cell depending on TableCursor mode)
Home / EndJump to first or last row
PageUp / PageDownMove up or down ten rows
EnterActivate the current row (sets state.activated)
SpaceToggle selection for the current row
sToggle sort on the current column

Header clicks also toggle sort. Column boundaries can be dragged to resize.

Tabs

KeyAction
Left / RightSwitch to the previous or next tab
Home / EndJump to the first or last tab
1..9Jump to tab 1 through 9
Ctrl-W or DeleteClose the current tab (when closable)
Space or EnterRe-activate the current tab (returns Outcome::Changed)

Mouse wheel over the tab bar also cycles tabs.

Deviations

Most widgets follow the patterns above without change. Two exceptions:

  • CommandPalette uses Home and End to jump to the start and end of the query input, not the result list. Use PageUp to reach the top of the list.
  • Modal in prompt mode sends all typing to the text input until you Tab to the buttons. Up/Down do not navigate; Left/Right and Tab move between buttons.

Showcase app keys

The showcase gallery app itself uses:

KeyAction
] / [Next or previous page
Alt-1..9Jump to page 1 through 9
Ctrl-POpen command palette (pages, themes, actions)
Ctrl-TCycle to the next theme
Ctrl-BToggle sidebar
F1Show help overlay
F3Toggle reduce motion (disables animations)
Ctrl-C / Ctrl-QQuit
qQuit (when no widget consumed the key)
EscDismiss all toasts (when no modal or dropdown is open)

Inside pages, Tab and Shift-Tab move focus, arrows adjust focused widgets, and Enter/Space activate.