Back to Projects
TUIX v0.5Beta

Last Updated: 2026-05-20

Examples

The v0.5 repository includes runnable examples under examples/widgets, examples/multimodal, and examples/showcase. They demonstrate widgets, focus routing, buffer hierarchy, and scene stats.

Widget Examples

FileDescription
examples/widgets/progressbar_dual.pyTwo bars filling at different speeds.
examples/widgets/choice_palette.pyColor palette menu that prints the selected RGB value.
examples/widgets/canvas_bounce.pyAnimated bouncing ball with color cycling and FPS counter.
examples/widgets/text_and_box_demo.pyText and box builder styling demo.
examples/widgets/button_and_badge_demo.pyButton and badge interaction demo.
examples/widgets/menu_and_tags_demo.pyMenu and tag widgets together.
examples/widgets/scroll_container_demo.pyScroll container viewport demo.

Multimodal And Showcase

FileDescription
examples/multimodal/focus_routing.pyKeyboard and mouse focus routing between choice and input.
examples/showcase/sequential_journey.pySequential demo: progressbar to choice to input to canvas.
examples/showcase/buffer_hierarchy_demo.pyParent-child buffer hierarchy and z-index layering.
examples/showcase/scene_stats_demo.pyScene stats snapshots and compaction APIs.

Run An Example

python examples/widgets/canvas_bounce.py

Recommended Patterns

  • Use scenes.set_focus(...) for keyboard routing when multiple interactive widgets are present.
  • Use snapshot APIs for diagnostics instead of raw buffer pointer getters.
  • Use layout builders and buffer slot APIs for nested composition rather than manually recalculating terminal geometry in Python.