Build Text User Interface (TUI) applications using the Textual Python framework (v0.86.0+). Use when creating terminal-based applications, prototyping card games or interactive CLIs, or when the user mentions Textual, TUI, or terminal UI. Includes comprehensive reference documentation, card game starter template, and styling guides.
This skill helps you build sophisticated Text User Interfaces (TUIs) using Textual, a Python framework for creating terminal and browser-based applications with a modern web-inspired API. It includes reference documentation, a card game template, and best practices for Textual development.
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, Label
class MyApp(App):
def compose(self) -> ComposeResult:
yield Header()
yield Label("Hello, Textual!")
yield Footer()
if __name__ == "__main__":
app = MyApp()
app.run()
For card game prototyping, copy the template:
cp -r assets/card-game-template/* ./my-game/
cd my-game
python app.py
The template includes:
See assets/card-game-template/README.md for customization guide.
This skill includes comprehensive reference files. Load them based on your task:
Read when: Setting up app structure, using reactive attributes, handling mounting, querying widgets, or working with messages/events.
Covers:
Read when: Adding UI elements like buttons, inputs, labels, data tables, or creating custom widgets.
Covers:
Read when: Designing layouts, positioning widgets, using grid systems, or handling responsive sizing.
Covers:
Read when: Applying CSS styles, theming, adding borders, or customizing widget appearance.
Covers:
Read when: Implementing keyboard shortcuts, handling mouse events, responding to user actions, or creating interactive behaviors.
Covers:
references/layout.md)references/widgets.md)references/styling.md)references/interactivity.md)app.tcssBINDINGSaction_*)on_button_pressed, etc.)reactive() for state that affects UI.tcss files, not inlineevent.stop() to control message propagationpip install textual
# or
uv pip install textual
Current version: v0.86.0+ (as of November 2025, latest is v6.6.0)
Comprehensive documentation loaded on-demand:
basics.md - Core concepts and app structurewidgets.md - Widget catalog and usagelayout.md - Layout systems and positioningstyling.md - CSS and theminginteractivity.md - Events, bindings, and actionscard-game-template/ - Complete starter template for card games with interactive cards, hands, and turn managementFor topics not covered in this skill, consult: