Skip to content

Examples

The package includes runnable examples under lazy_cuh.examples. Their metadata lives in lazy_cuh.examples.EXAMPLES so scripts, flake apps, and docs can stay aligned as new examples are added.

The easiest way to run the main demo from the repository is:

Terminal window
uv run lazy-cuh-demo

Direct module execution also works:

Terminal window
uv run python -m lazy_cuh.examples.demo

The Nix app is available too:

Terminal window
nix run .#demo

The demo app exercises panel titles, shell focus, contextual keybars, list widgets, tree widgets, relative line numbers, and item highlight/selection messages.

Focused examples isolate one behavior at a time. They are useful when testing API choices without changing the main demo.

Terminal window
nix run .#example-text-wrap
nix run .#example-help-modal
nix run .#example-help-keybar
nix run .#example-options

Equivalent Python entry points are available after installing the package:

Terminal window
uv run lazy-cuh-example-text-wrap
uv run lazy-cuh-example-help-modal
uv run lazy-cuh-example-help-keybar
uv run lazy-cuh-example-options

Direct module execution works too:

Terminal window
uv run python -m lazy_cuh.examples.text_wrap
uv run python -m lazy_cuh.examples.help_modal
uv run python -m lazy_cuh.examples.help_keybar
uv run python -m lazy_cuh.examples.options
  • example-text-wrap shows TextViewSpec.width with TRUNCATE, MULTILINE, and WRAP side by side.
  • example-help-modal binds ? to an info modal containing keybindings.
  • example-help-keybar binds the same key to expanded keybar rows. Keeping both examples makes the different help presentation styles easy to compare.
  • example-options shows editable option rows backed by typed input modal parsing and validation.