The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
Build cross-platform user interfaces with a simple Python API. Run your apps in the terminal or a web browser.
Textual's API combines modern Python with the best of developments from the web world, for a lean app development experience. De-coupled components and an advanced testing framework ensure you can maintain your app for the long-term.
Want some more examples? See the examples directory.
…[!TIP] Textual is an asynchronous framework under the hood. Which means you can integrate your apps with async libraries — if you want to. If you don't want or need to use async, Textual won't force it on you.
Textual's library of widgets covers everything from buttons, tree controls, data tables, inputs, text areas, and more… Combined with a flexible layout system, you can realize any User Interface you need.
Predefined themes ensure your apps will look good out of the box.
Install Textual via pip:
pip install textual textual-devSee getting started for details.
Run the following command to see a little of what Textual can do:
python -m textualOr try the textual demo without installing (requires uv):
uvx --python 3.12 textual-demoHow do you debug an app in the terminal that is also running in the terminal?
The textual-dev package supplies a dev console that connects to your application from another terminal.
In addition to system messages and events, your logged messages and print statements will appear in the dev console.
See the guide for other helpful tools provided by the textual-dev package.
Textual apps have a fuzzy search command palette.
Hit ctrl+p to open the command palette.
It is easy to extend the command palette with custom commands for your application.
Textual apps are equally at home in the browser as they are the terminal. Any Textual app may be served with textual serve — so you can share your creations on the web.
Here's how to serve the demo app:
textual serve "python -m textual"In addition to serving your apps locally, you can serve apps with Textual Web.
Textual Web's firewall-busting technology can serve an unlimited number of applications.
Since Textual apps have low system requirements, you can install them anywhere Python also runs. Turning any device into a connected device. No desktop required!
Join the Textual developers and community on our Discord Server.
Narrow Screen.refresh(Region) can discard another widget's repaint
Kitty key reports longer than 32 characters are typed out as keys, garbling input-method commits
Docs about async event handlers recommand the asyncio API instead of Workers
clear_panes() docstring says "optionally awaitable" but skipping the await causes DuplicateIds
WebDriver ignores App.run(mouse=False) and enables mouse reporting anyway
RichLog horizontal scrollbar never shrinks when max_lines is set (Ghost Scrollbar)
BINDINGS typed as `list[BindingType]` prevent subclasses from using a tuple
Markdown.update can leave a detached MarkdownParagraph in the compositor and crash MouseDown selection
App.suspend() skips resume_application_mode() when the suspended body raises, deadlocking the app
ZeroDivisionError parsing pixel mouse events when terminal pixel size is (0, 0)