brick  by jtdaugherty

Haskell TUI toolkit

Created 10 years ago
1,691 stars

Top 24.9% 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

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
2
Star History
5 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Elvis Saravia Elvis Saravia(Founder of DAIR.AI).

DeepCode by HKUDS

0.5%
14k
AI agents transform ideas into production-ready code
Created 8 months ago
Updated 2 weeks ago
Feedback? Help us improve.