Clone
3
Examples
Yves Biener edited this page 2025-10-26 21:43:44 +01:00

Examples

You can build the every example through the example option. For example:

zig build --release=safe -Dexample=demo run

Tip

Every example application can be quit using ctrl+c.

You can also build all examples by providing no argument for the example option, as the default builds all examples.

zig build

Note

In debug build mode log messages will be written to stderr. You can pipe the output of stderr to a file when running in debug mode to not disturb the tui rendering. e.g. ./zig-out/bin/demo run 2> log

For all available examples run zig build --help

The examples are structured in four categories:

  • Overall examples: i.e. Error handling, Demo application, ..
  • Elements: i.e. Button, Input, Scrollable, ..
  • Layouts: i.e. Vertical, Horizontal, Grid, Mixed, ..
  • Styles: i.e. Color palette, Text styles, ..

They serve to provide examples on how to use the library as well as showcase the capabilities of the library. For the implementation source files see examples.