{"id":13616765,"url":"https://github.com/jtdaugherty/brick","last_synced_at":"2025-04-23T20:54:27.366Z","repository":{"id":31755031,"uuid":"35321175","full_name":"jtdaugherty/brick","owner":"jtdaugherty","description":"A declarative Unix terminal UI library written in Haskell","archived":false,"fork":false,"pushed_at":"2025-04-23T15:43:21.000Z","size":3002,"stargazers_count":1632,"open_issues_count":4,"forks_count":167,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-23T20:54:06.788Z","etag":null,"topics":["curses","framework","haskell","terminal","tui","ui","vty"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtdaugherty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-09T08:23:44.000Z","updated_at":"2025-04-23T15:43:25.000Z","dependencies_parsed_at":"2023-11-09T17:27:28.065Z","dependency_job_id":"9c934934-b4f3-4760-88c0-862d0ea2662e","html_url":"https://github.com/jtdaugherty/brick","commit_stats":{"total_commits":1877,"total_committers":98,"mean_commits":"19.153061224489797","dds":"0.17368140649973363","last_synced_commit":"816617d24a1e72fb9880e4a2582e8a7d688f4872"},"previous_names":[],"tags_count":148,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdaugherty%2Fbrick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdaugherty%2Fbrick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdaugherty%2Fbrick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtdaugherty%2Fbrick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtdaugherty","download_url":"https://codeload.github.com/jtdaugherty/brick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514767,"owners_count":21443208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curses","framework","haskell","terminal","tui","ui","vty"],"created_at":"2024-08-01T20:01:32.983Z","updated_at":"2025-04-23T20:54:27.352Z","avatar_url":"https://github.com/jtdaugherty.png","language":"Haskell","funding_links":[],"categories":["Haskell","ASCII UI/UX Frameworks \u0026 Foundations"],"sub_categories":["Imported: Upstream Snippet Gallery"],"readme":"![](logo/brick-final-clearbg-with-text.svg)\n\n`brick` is a Haskell terminal user interface (TUI) programming toolkit.\nTo use it, you write a pure function that describes how your user\ninterface should be drawn based on your current application state and\nyou provide a state transformation function to handle events.\n\n`brick` exposes a declarative API. Unlike most GUI toolkits which\nrequire you to write a long and tedious sequence of widget creations\nand layout setup, `brick` just requires you to describe your interface\nusing a set of declarative layout combinators. Event-handling is done by\npattern-matching on incoming events and updating your application state.\n\nUnder the hood, this library builds upon\n[vty](http://hackage.haskell.org/package/vty), so some knowledge of Vty\nwill be necessary to use this library. Brick depends on\n`vty-crossplatform`, so Brick should work anywhere Vty works (Unix and\nWindows). Brick releases prior to 2.0 only support Unix-based systems.\n\nExample\n-------\n\nHere's an example interface (see `programs/ReadmeDemo.hs`):\n\n```\njoinBorders $\nwithBorderStyle unicode $\nborderWithLabel (str \"Hello!\") $\n(center (str \"Left\") \u003c+\u003e vBorder \u003c+\u003e center (str \"Right\"))\n```\n\nResult:\n\n```\n┌─────────Hello!─────────┐\n│           │            │\n│           │            │\n│   Left    │   Right    │\n│           │            │\n│           │            │\n└───────────┴────────────┘\n```\n\nFeatured Projects\n-----------------\n\nTo get an idea of what some people have done with `brick`, check out\nthese projects. If you have made something and would like me to include\nit, get in touch!\n\n| Project | Description |\n| ------- | ----------- |\n| [`2048Haskell`](https://github.com/8Gitbrix/2048Haskell) | An implementation of the 2048 game |\n| [`babel-cards`](https://github.com/srhoulam/babel-cards) | A TUI spaced-repetition memorization tool. Similar to Anki. |\n| [`bhoogle`](https://github.com/andrevdm/bhoogle) | A [Hoogle](https://www.haskell.org/hoogle/) client |\n| [`brewsage`](https://github.com/gerdreiss/brewsage#readme) | A TUI for Homebrew |\n| [`brick-trading-journal`](https://codeberg.org/amano.kenji/brick-trading-journal) | A TUI program that calculates basic statistics from trades |\n| [`Brickudoku`](https://github.com/Thecentury/brickudoku) | A hybrid of Tetris and Sudoku |\n| [`cbookview`](https://github.com/mlang/cbookview) | A TUI for exploring polyglot chess opening book files |\n| [`clifm`](https://github.com/pasqu4le/clifm) | A file manager |\n| [`codenames-haskell`](https://github.com/VigneshN1997/codenames-haskell) | An implementation of the Codenames game |\n| [`fifteen`](https://github.com/benjaminselfridge/fifteen) | An implementation of the [15 puzzle](https://en.wikipedia.org/wiki/15_puzzle) |\n| [`ghcup`](https://www.haskell.org/ghcup/) | A TUI for `ghcup`, the Haskell toolchain manager |\n| [`git-brunch`](https://github.com/andys8/git-brunch) | A git branch checkout utility |\n| [`Giter`](https://gitlab.com/refaelsh/giter) | A UI wrapper around Git CLI inspired by [Magit](https://magit.vc/). |\n| [`gotta-go-fast`](https://github.com/callum-oakley/gotta-go-fast) | A typing tutor |\n| [`haradict`](https://github.com/srhoulam/haradict) | A TUI Arabic dictionary powered by [ElixirFM](https://github.com/otakar-smrz/elixir-fm) |\n| [`hascard`](https://github.com/Yvee1/hascard) | A program for reviewing \"flash card\" notes |\n| [`haskell-player`](https://github.com/potomak/haskell-player) | An `afplay` frontend |\n| [`herms`](https://github.com/jackkiefer/herms) | A command-line tool for managing kitchen recipes |\n| [`hic-hac-hoe`](https://github.com/blastwind/hic-hac-hoe) | Play tic tac toe in terminal! |\n| [`hledger-iadd`](http://github.com/rootzlevel/hledger-iadd) | An interactive terminal UI for adding hledger journal entries |\n| [`hledger-ui`](https://github.com/simonmichael/hledger) | A terminal UI for the hledger accounting system. |\n| [`homodoro`](https://github.com/c0nradLC/homodoro) | A terminal application to use the pomodoro technique and keep track of daily tasks |\n| [`hskanban`](https://github.com/vincentaxhe/hskanban) | A Kanban organizer |\n| [`htyper`](https://github.com/Simon-Hostettler/htyper) | A typing speed test program |\n| [`hyahtzee2`](https://github.com/DamienCassou/hyahtzee2#readme) | Famous Yahtzee dice game |\n| [`kpxhs`](https://github.com/akazukin5151/kpxhs) | An interactive [Keepass](https://github.com/keepassxreboot/keepassxc/) database viewer |\n| [`matterhorn`](https://github.com/matterhorn-chat/matterhorn) | A client for [Mattermost](https://about.mattermost.com/) |\n| [`maze`](https://github.com/benjaminselfridge/maze) | A Brick-based maze game |\n| [`monad-torrent`](https://github.com/davorluc/monad-torrent) | A simple and minimal torrent client |\n| [`monalog`](https://github.com/goosedb/Monalog) | Terminal logs observer |\n| [`mushu`](https://github.com/elaye/mushu) | An `MPD` client |\n| [`mywork`](https://github.com/kquick/mywork) [[Hackage]](https://hackage.haskell.org/package/mywork) | A tool to keep track of the projects you are working on |\n| [`pboy`](https://github.com/2mol/pboy) | A tiny PDF organizer |\n| [`purebred`](https://github.com/purebred-mua/purebred) | A mail user agent |\n| [`sandwich`](https://codedownio.github.io/sandwich/) | A test framework with a TUI interface |\n| [`silly-joy`](https://github.com/rootmos/silly-joy) | An interpreter for Joy |\n| [`solitaire`](https://github.com/ambuc/solitaire) | The card game |\n| [`sudoku-tui`](https://github.com/evanrelf/sudoku-tui) | A Sudoku implementation |\n| [`summoner-tui`](https://github.com/kowainik/summoner/tree/master/summoner-tui) | An interactive frontend to the Summoner tool |\n| [`swarm`](https://github.com/byorgey/swarm/) | A 2D programming and resource gathering game |\n| [`tart`](https://github.com/jtdaugherty/tart) | A mouse-driven ASCII art drawing program |\n| [`tick-tock-tui`](https://github.com/sectore/tick-tock-tui) | A stylish TUI app to handle Bitcoin data provided by [Mempool REST API](https://mempool.space/docs/api/rest) incl. blocks, fees and price converter. |\n| [`tetris`](https://github.com/SamTay/tetris) | An implementation of the Tetris game |\n| [`thock`](https://github.com/rmehri01/thock) | A modern TUI typing game featuring online racing against friends |\n| [`timeloop`](https://github.com/cdupont/timeloop) | A time-travelling demonstrator |\n| [`towerHanoi`](https://github.com/shajenM/projects/tree/master/towerHanoi) | Animated solutions to The Tower of Hanoi |\n| [`ttyme`](https://github.com/evuez/ttyme) | A TUI for [Harvest](https://www.getharvest.com/) |\n| [`ullekha`](https://github.com/ajithnn/ullekha) | An interactive terminal notes/todo app with file/redis persistence |\n| [`viewprof`](https://github.com/maoe/viewprof) | A GHC profile viewer |\n| [`VOIDSPACE`](https://github.com/ChrisPenner/void-space) | A space-themed typing-tutor game |\n| [`wordle`](https://github.com/ivanjermakov/wordle) | An implementation of the Wordle game |\n| [`wrapping-editor`](https://github.com/ta0kira/wrapping-editor) | An embeddable editor with support for Brick |\n| [`youbrick`](https://github.com/florentc/youbrick) | A feed aggregator and launcher for Youtube channels |\n\nThese third-party packages also extend `brick`:\n\n| Project | Description |\n| ------- | ----------- |\n| [`brick-filetree`](https://github.com/ChrisPenner/brick-filetree) [[Hackage]](http://hackage.haskell.org/package/brick-filetree) | A widget for exploring a directory tree and selecting or flagging files and directories |\n| [`brick-panes`](https://github.com/kquick/brick-panes) [[Hackage]](https://hackage.haskell.org/package/brick-panes) | A Brick overlay library providing composition and isolation of screen areas for TUI apps. |\n| [`brick-calendar`](https://github.com/ldgrp/brick-calendar) [[Hackage]](https://hackage.haskell.org/package/brick-calendar) | A library providing a calendar widget for Brick-based applications. |\n\nGetting Started\n---------------\n\nCheck out the many demo programs to get a feel for different aspects of\nthe library:\n\n```\n$ cabal new-build -f demos\n$ find dist-newstyle -type f -name \\*-demo\n```\n\nTo get started, see the [user guide](https://github.com/jtdaugherty/brick/blob/master/docs/guide.rst).\n\nDocumentation\n-------------\n\nDocumentation for `brick` comes in a variety of forms:\n\n* [The official brick user guide](https://github.com/jtdaugherty/brick/blob/master/docs/guide.rst)\n* [Haddock documentation](https://hackage.haskell.org/package/brick)\n* [Demo programs](https://github.com/jtdaugherty/brick/blob/master/programs)\n* [FAQ](https://github.com/jtdaugherty/brick/blob/master/FAQ.md)\n\nFeature Overview\n----------------\n\n`brick` comes with a bunch of batteries included:\n\n * Vertical and horizontal box layout widgets\n * Basic single- and multi-line text editor widgets\n * List and table widgets\n * Progress bar widget\n * Simple dialog box widget\n * Border-drawing widgets (put borders around or in between things)\n * Animation support\n * Generic scrollable viewports and viewport scroll bars\n * General-purpose layout control combinators\n * Extensible widget-building API\n * User-customizable attribute themes\n * Type-safe, validated input form API (see the `Brick.Forms` module)\n * A filesystem browser for file and directory selection\n * Borders can be configured to automatically connect!\n\nBrick Discussion\n----------------\n\nThere are two forums for discussing brick-related things:\n\n1. The [Discussions page](https://github.com/jtdaugherty/brick/discussions) on the github repo, and\n1. The `brick-users` Google Group / e-mail list. You can subscribe\n   [here](https://groups.google.com/group/brick-users).\n\nStatus\n------\n\nThere are some places were I have deliberately chosen to worry about\nperformance later for the sake of spending more time on the design\n(and to wait on performance issues to arise first). `brick` is also\nsomething of an experimental project of mine and some aspects of the\ndesign involve trade-offs that might not be right for your application.\nBrick is not intended to be all things to all people; rather, I want it\nto provide a good foundation for building complex terminal interfaces\nin a declarative style to take away specific headaches of building,\nmodifying, and working with such interfaces, all while seeing how far we\ncan get with a pure function to specify the interface.\n\n`brick` exports an extension API that makes it possible to make your own\npackages and widgets. If you use that, you'll also be helping to test\nwhether the exported interface is usable and complete!\n\nA note on Windows support\n-------------------------\n\nBrick supports Windows implicitly by way of Vty's Windows support.\nWhile I don't (and can't) personally test Brick on Windows hosts,\nit should be possible to use Brick on Windows. If you have any\ntrouble, report any issues here. If needed, we'll migrate them to the\n[vty-windows](https://github.com/chhackett/vty-windows) repository if\nthey need to be fixed there.\n\nReporting bugs\n--------------\n\nPlease file bug reports as GitHub issues.  For best results:\n\n - Include the versions of relevant software packages: your terminal\n   emulator, `brick`, `ghc`, `vty`, and Vty platform packages will be\n   the most important ones.\n\n - Clearly describe the behavior you expected ...\n\n - ... and include a minimal demonstration program that exhibits the\n   behavior you actually observed.\n\nContributing\n------------\n\nIf you decide to contribute, that's great! Here are some guidelines you\nshould consider to make submitting patches easier for all concerned:\n\n - If you want to take on big things, talk to me first; let's have a\n   design/vision discussion before you start coding. Create a GitHub\n   issue and we can use that as the place to hash things out.\n - Please make changes consistent with the conventions I've used in the\n   codebase.\n - Please adjust or provide Haddock and/or user guide documentation\n   relevant to any changes you make.\n - Please ensure that commits are `-Wall` clean.\n - Please ensure that each commit makes a single, logical, isolated\n   change as much as possible.\n - Please do not submit changes that your linter told you to make. I\n   will probably decline them. Relatedly: please do not submit changes\n   that change only style without changing functionality.\n - Please do NOT include package version changes in your patches.\n   Package version changes are only done at release time when the full\n   scope of a release's changes can be evaluated to determine the\n   appropriate version change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtdaugherty%2Fbrick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtdaugherty%2Fbrick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtdaugherty%2Fbrick/lists"}