Skip to contents

App lifecycle

Create and run TUI applications.

tui_app()
Create a TUI application
quick_app()
Run a TUI app in one call
quit()
Signal app termination from a callback

Convenience apps

One-call apps for common tasks.

data_viewer()
Interactive data viewer
browse_files()
Interactive file browser

Layout containers

Arrange widgets spatially.

vstack()
Create a vertical stack layout
hstack()
Create a horizontal stack layout
grid()
Create a grid layout
center()
Create a center-aligned container
middle()
Create a middle-aligned container (vertical centering)
scroll()
Create a scrollable container
container()
Create a plain block container
box()
Create a box widget with optional border

Tabs, headers, footers, collapsibles, and trees.

header()
Create a header widget
footer()
Create a footer widget
tabs()
Create a tabbed pane container
tab_pane()
Create a single tab pane
collapsible()
Create a collapsible section
content_switcher()
Create a content switcher (shows one child at a time)
tree()
Create a tree widget
directory_tree()
Create a directory tree widget

Display widgets

Show text, data, and visual indicators.

text()
Create a text widget
static()
Create a static rich text widget
markdown()
Create a markdown display widget
digits()
Create a large digits display widget
pretty_table()
Create a pretty table widget (rich-formatted)
sparkline()
Create a sparkline widget
progress_bar()
Create a progress bar widget
rule()
Create a horizontal rule (divider) widget
loading()
Create a loading indicator widget
placeholder()
Create a placeholder widget
log_view()
Create an append-only log view widget

Input widgets

Buttons, text fields, selects, and lists.

button()
Create a button widget
input()
Create a text input widget
text_area()
Create a multi-line text area widget
masked_input()
Create a masked input widget
checkbox()
Create a checkbox widget
switch_input()
Create a switch (toggle) widget
select()
Create a select dropdown widget
radio_set()
Create a radio set (group of radio buttons)
radio_button()
Create a radio button widget (use inside radio_set)
data_table()
Create a data table widget
option_list()
Create an option list widget
selection_list()
Create a selection list (multi-select)
list_view()
Create a list view widget

Charts

Terminal charts powered by plotext.

text_plot()
Create a text-based plot widget
plot_bar()
Draw a bar chart on a plot widget
plot_line()
Draw a line plot on a plot widget
plot_scatter()
Draw a scatter plot on a plot widget
plot_hist()
Draw a histogram on a plot widget
plot_box()
Draw a box plot on a plot widget
plot_heatmap()
Draw a heatmap on a plot widget
plot_candlestick()
Draw a candlestick chart on a plot widget
plot_stacked_bar()
Draw a stacked bar chart on a plot widget
plot_multiple_bar()
Draw a grouped (multiple) bar chart on a plot widget
plot_error()
Draw error bars on a plot widget
plot_event()
Draw an event plot on a plot widget
plot_ggplot()
Render a ggplot2 object on a text_plot widget

Widget updates

Modify widgets at runtime.

update()
Update a widget by id
notify()
Show a notification
log_write()
Write a line to a log_view widget
dark_toggle()
Toggle dark mode
copy_to_clipboard()
Copy text to system clipboard

Events

Event constructors (internal/testing).

event_change()
Wrap a function as a change-event handler
event_click()
Wrap a function as a click-event handler
event_key()
Wrap a function as a key-event handler

State and reactivity

Manage mutable app state.

tui_state()
Create a mutable TUI state object
reactive()
Define reactive bindings between state keys and widgets

Screens and dialogs

Multi-screen apps and modal dialogs.

tui_screen()
Create a screen spec
push_screen()
Push a screen onto the screen stack
pop_screen()
Pop the current screen from the stack
confirm()
Show a confirmation dialog
alert()
Show an alert dialog

Timers and workers

Scheduled, repeating, and background tasks.

set_timer()
Create a one-shot timer
set_interval()
Create a repeating interval timer
clear_timer()
Cancel a running timer
set_worker()
Start a background worker
cancel_worker()
Cancel a running worker
run_async()
Run a function asynchronously in a background process
cancel_async()
Cancel a running async task

Key bindings

Keyboard shortcuts and actions.

binding()
Create a key binding

Command palette

Searchable command interface.

command()
Define a command palette entry
register_commands()
Register commands for the command palette

Forms

Structured form input.

tui_form()
Create a form with named inputs and a submit button
collect_form()
Collect form values from the running app

Themes

Built-in colour themes.

tui_theme()
Get a built-in theme CSS string
list_themes()
List available theme names

Setup

Installation helpers.

install_python_deps()
Install Python dependencies for rtui
rtui_doctor()
Check the local rtui setup
dev_app()
Run an app with hot reload