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. https://textual.textualize.io/
  • Python 98.8%
  • Tree-sitter Query 0.8%
  • Jinja 0.3%
  • TypeScript 0.1%
Find a file
2026-05-19 17:48:41 +07:00
.faq Update suggest.md 2025-06-21 17:36:49 +01:00
.github Update PR template to include contribution guidelines 2025-12-18 10:09:11 +00:00
docs content render 2026-04-26 21:11:02 +07:00
examples updated code browser to use new code highlight 2025-07-16 18:31:35 +01:00
imgs
notes
questions Remove typo from why-no-ansi-themes.question.md 2025-05-20 14:26:07 -05:00
reference Further docs updates to get rid of App.dark 2024-10-24 17:22:54 +01:00
src/textual text opacity change 2026-05-19 15:11:18 +07:00
tests snapshot 2026-05-19 15:17:52 +07:00
tools
.coveragerc Ignore abstractmethods. 2023-05-25 17:22:21 +01:00
.deepsource.toml Add Deepsource configuration. (#2766) 2023-06-12 10:52:14 +01:00
.gitignore snapshot test 2026-05-13 16:08:31 +07:00
.pre-commit-config.yaml Open log file with utf-8 encoding. 2025-07-09 14:00:30 +01:00
AI_POLICY.md Create AI_POLICY.md for AI PR guidelines 2026-02-13 13:01:34 +00:00
CHANGELOG.md bump 2026-05-19 15:23:51 +07:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md Update old contributing guide (#4872) 2024-08-12 11:12:56 +01:00
docs.md
faq.yml Move the Textual FAQ into the main docs 2023-08-21 14:41:07 +01:00
LICENSE
Makefile Expose code intend guides 2025-06-20 12:56:13 +01:00
mkdocs-common.yml tweaks 2024-07-18 09:50:36 +01:00
mkdocs-nav.yml docs 2026-01-25 17:13:58 +00:00
mkdocs-offline.yml Remove the privacy plugin from the offline version of the docs 2023-05-29 07:40:30 +01:00
mkdocs-online.yml Only link Python and Rich types when building full docs 2023-05-29 08:30:23 +01:00
mypy.ini Drop implicit uvloop support. 2023-03-27 18:37:21 +01:00
poetry.lock bump 2025-10-22 18:08:18 +01:00
pyproject.toml bump 2026-05-19 15:23:51 +07:00
README.md docs(readme): update python versions badge 2025-10-07 13:25:59 +01:00
uv.lock test fixes 2026-03-27 15:40:35 +07:00

Discord Supported Python Versions PyPI version OS support

textual-splash

Textual

clock

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.

buttons

tree

datatables

inputs

listview

textarea

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

devtools

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.

Command Palette

Textual ❤️ Web

textual-serve

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.