Brick is a Haskell terminal user interface (TUI) programming toolkit that enables developers to build rich, responsive terminal applications via a declarative model: you define a pure function that renders the UI from application state and supply state transition logic to handle events. brick exposes a declarative API. Unlike most GUI toolkits which require you to write a long and tedious sequence of widget creations and layout setup, brick just requires you to describe your interface using a set of declarative layout combinators. Event-handling is done by pattern-matching on incoming events and updating your application state. Under the hood, this library builds upon vty, so some knowledge of Vty will be necessary to use this library. Brick depends on vty-crossplatform, so Brick should work anywhere Vty works (Unix and Windows). Brick releases prior to 2.0 only support Unix-based systems.
Features
- Purely functional UI drawing based on application state
- Declarative design model separating view logic and event handling
- Supports layout, focus, scrolling, rendering cache, and cursor control
- Ideal for building text editors, dashboards, games, and more
- Offers widget composition with customizable rendering behavior
- Backed by comprehensive guide and documentation to ease adoption