brick  by jtdaugherty

Haskell TUI toolkit

created 10 years ago
1,656 stars

Top 25.4% on SourcePulse

GitHubView on GitHub
Project Summary

Brick is a Haskell library for building declarative terminal user interfaces (TUIs). It targets Haskell developers seeking a structured, pure functional approach to TUI development, simplifying complex UI layouts and event handling.

How It Works

Brick employs a declarative API where the UI is described as a pure function of the application state. Event handling is managed by pattern matching on events to update this state. This approach, built on the vty library, abstracts away low-level terminal manipulation, allowing developers to focus on UI structure and logic.

Quick Start & Requirements

  • Install via cabal new-build -f demos to build demo programs.
  • Requires GHC and Cabal.
  • Demo programs can be found via find dist-newstyle -type f -name \*-demo.
  • Official user guide and Haddock documentation are available.

Highlighted Details

  • Declarative API for UI layout using combinators.
  • Pure function approach for UI description and state transformation.
  • Built upon vty for cross-platform (Unix, Windows) compatibility.
  • Features include layout widgets, editors, lists, tables, progress bars, dialogs, borders, animation, scrollable viewports, and type-safe forms.
  • Extensible API for custom widgets and packages.

Maintenance & Community

  • Active community discussions via GitHub Discussions and a Google Group.
  • Projects using Brick are showcased, encouraging contributions.

Licensing & Compatibility

  • License not explicitly stated in the README, but typically Haskell libraries are permissive (e.g., MIT, BSD). Compatibility with commercial or closed-source projects is likely, pending explicit license confirmation.

Limitations & Caveats

Performance has been deliberately deferred in favor of design exploration. Brick is experimental, and some design trade-offs may not suit all applications. Windows support is implicit via vty and may require issue reporting for specific problems.

Health Check
Last commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
6 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.