No description
Find a file
2025-03-24 13:38:34 +00:00
.faq faq tweak 2023-08-26 10:57:44 +01:00
.github Update bug_report.md 2025-02-13 09:49:49 +00:00
docs words 2025-03-12 16:36:53 +07:00
examples docs: fix 'into' grammar 2024-12-30 20:33:02 +00:00
imgs added demo.svg back for pypi 2022-10-22 21:30:12 +01:00
notes remove useless note 2022-10-22 08:36:52 +01:00
questions Fix admonition syntax to use tip 2024-09-26 00:52:42 +08:00
reference Further docs updates to get rid of App.dark 2024-10-24 17:22:54 +01:00
src/textual remove LinePadding 2025-03-24 13:38:34 +00:00
tests tests, tabs 2025-03-19 17:17:00 +00:00
tools Remove 'action' column from bindings. 2023-01-25 15:00:45 +00:00
.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 Update gitignore to refer to new default snapshot report location (#2927) 2023-07-12 11:08:33 +01:00
.pre-commit-config.yaml absolutify 2024-09-12 15:29:16 +01:00
CHANGELOG.md Assign names to threads 2025-03-15 19:30:03 +01:00
CODE_OF_CONDUCT.md Added the Code of Conduct 2022-02-04 23:36:37 +06:00
CONTRIBUTING.md Update old contributing guide (#4872) 2024-08-12 11:12:56 +01:00
docs.md Restore the content of docs.md 2022-11-17 15:51:38 +00:00
faq.yml Move the Textual FAQ into the main docs 2023-08-21 14:41:07 +01:00
LICENSE Initial commit 2021-04-08 16:24:48 +01:00
Makefile Snapshot updates 2024-11-06 14:29:50 +00:00
mkdocs-common.yml tweaks 2024-07-18 09:50:36 +01:00
mkdocs-nav.yml docs update 2025-02-07 13:49:38 +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 fix tree sitter deps 2025-02-17 18:15:59 +00:00
pyproject.toml version bump 2025-02-26 19:00:44 +00:00
README.md docs: fix 'into' grammar 2024-12-30 20:33:02 +00: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.