Textual-Pyfiglet¶
Installation¶
Or using uv:
Demo app¶
You can instantly try out the demo app using uv or pipx:
Or if you have it downloaded into your python environment, run it using the entry script:
For uv users:
Getting Started¶
Import into your project with:
The FigletWidget works out of the box with default settings. The most basic usage does not require any arguments aside from the input text:
In the above example, it will use the default font: 'standard'.
You can also specify a font as an argument:
Live updating¶
To update the FigletWidget with new text, simply pass it in the update
method:
For instance, if you have a TextArea widget where a user can enter text, you can do this:
from textual import on
@on(TextArea.Changed)
def text_changed(self):
text = self.query_one("#text_input").text
self.query_one("#figlet1").update(text)
The FigletWidget will then auto-update with every key-stroke.
Changing font / justification¶
You can set the font directly using the set_font
method. This method is type hinted
to give you auto-completion for the fonts:
Likewise to set the justification:
Colors, Gradients, and Animation¶
This section is not complete yet (The color/animation system is still under development, but you can see it action in the demo app).