Skip to content

sunbeam60/tuile

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tuile

A Text User Interface library for Zig.
Breaking changes are possible.
Explore the docs »

View Examples · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Tuile is a Text User Interface library written in Zig.

Tuile currently support ncurses and crossterm backends, but if you want to see another one submit a PR or file a feature request.

Demo VHS recording

Checkout the other examples here.

(back to top)

Getting Started

Prerequisites

  • Zig 0.12.0+
  • See Backends for the list of requirements depending on the backend you want to use.

Installation

  1. Add dependency to your build.zig.zon
zig fetch --save https://github.com/akarpovskii/tuile/archive/refs/tags/v0.1.1.tar.gz
  1. Import Tuile in build.zig:
const tuile = b.dependency("tuile", .{});
exe.root_module.addImport("tuile", tuile.module("tuile"));

(back to top)

Usage

const tuile = @import("tuile");

pub fn main() !void {
    var tui = try tuile.Tuile.init(.{});
    defer tui.deinit();

    try tui.add(
        tuile.block(
            .{
                .border = tuile.Border.all(),
                .border_type = .rounded,
                .layout = .{ .flex = 1 },
            },
            tuile.label(.{ .text = "Hello World!" }),
        ),
    );

    try tui.run();
}

You can find more examples in the examples folder

(back to top)

Roadmap

In no particular order:

  • Documentation
  • Grid layout
  • Windows and dialogs
  • Menu bar
  • More widgets
  • Other backends
  • Unicode support

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/amazing-feature)
  3. Commit your Changes (git commit -m 'Add some Amazing Feature')
  4. Push to the Branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Acknowledgments

(back to top)

About

A Text UI library for Zig

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Zig 94.2%
  • Rust 5.8%