textual
Textual is a Python framework for building interactive applications with a CSS-styled, widget-based, reactive API that run in the terminal and can also be served to a web browser. It brings web-style layout and theming to TUIs while staying async-optional.
MITPermissive — free to use in commercial and proprietary software, with attribution.View license →
Production readiness
4/5- Actively maintainedCommits in the last 6 months
- No known vulnerabilitiesNot yet scanned
- Clear, usable licenseMIT (permissive)
- Proven adoptionWidely used
- Has documentationDocumentation indexed
pip install textualOur analysis
Textual is a Python TUI (text user interface) framework from the makers of Rich. It uses a declarative widget tree, CSS-like styling, and a reactive event/message system, and the same app can run in a terminal or be served to a web browser.
When to use textual
Use it to build rich interactive terminal applications — dashboards, dev tools, installers, monitoring UIs — where you want web-like layout, theming, and a real component model without writing a desktop GUI. Good when you want one codebase that works in a terminal and over the web via textual serve.
When not to
Not a fit for non-interactive scripts or simple CLIs (use Click/Typer/Rich directly), for high-fidelity GUIs needing native widgets or graphics (use Qt/Tkinter/web), or when you need a production web app where a real browser frontend framework is more appropriate.
Strengths
- CSS-based styling and flexible layout system familiar to web developers
- Large built-in widget library (data tables, trees, inputs, text areas) with predefined themes
- Async-optional architecture integrates cleanly with async libraries
- Strong tooling: dev console, command palette, and a dedicated testing framework
- Run-anywhere story: same app in terminal or browser via textual serve / Textual Web
Trade-offs
- Constrained by terminal capabilities (fonts, colors, no raster graphics) compared to true GUIs
- Reactive/message-driven model has a learning curve beyond simple print-based scripts
- Web serving renders terminal output rather than native HTML, so it's not a substitute for a real web app
- Python-only; not usable from other languages
- Heavier dependency footprint than minimal CLI libraries for small tools
Maturity
Mature and actively maintained by Textualize with a large community (36k+ stars), comprehensive docs, and a growing ecosystem (textual-dev, textual-web). Widely adopted for serious tools, though the API has evolved and some apps may need updates across releases.
Textual
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.
"""
An App to show the current time.
"""
from datetime import datetime
from textual.app import App, ComposeResult
from textual.widgets import Digits
class ClockApp(App):
CSS = """
Screen { align: center middle; }
Digits { width: auto; }
"""
def compose(self) -> ComposeResult:
yield Digits("")
def on_ready(self) -> None:
self.update_clock()
self.set_interval(1, self.update_clock)
def update_clock(self) -> None:
clock = datetime.now().time()
self.query_one(Digits).update(f"{clock:%T}")
if __name__ == "__main__":
app = ClockApp()
app.run()
[!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.
Widgets
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.
Installing
Install Textual via pip:
pip install textual textual-dev
See getting started for details.
Demo
Run the following command to see a little of what Textual can do:
python -m textual
Or try the textual demo without installing (requires uv):
uvx --python 3.12 textual-demo
Dev Console
How 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.
Command Palette
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 ❤️ Web
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 us on Discord
Join the Textual developers and community on our Discord Server.