brick: A declarative terminal user interface library

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

Write terminal applications painlessly with brick! You write an event handler and a drawing function and the library does the rest.

module Main where

import Brick

ui :: Widget ()
ui = str "Hello, world!"

main :: IO ()
main = simpleMain ui

To get started, see:

This package deprecates vty-ui.


[Skip to ReadMe]

Properties

Versions0.1, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.3, 0.3.1, 0.4, 0.4.1, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.15.1, 0.15.2, 0.16, 0.17, 0.17.1, 0.17.2, 0.18, 0.19, 0.20, 0.20.1, 0.21, 0.22, 0.23, 0.24, 0.24.1, 0.24.2, 0.25, 0.26, 0.26.1, 0.27, 0.28, 0.29, 0.29.1, 0.30, 0.31, 0.32, 0.32.1, 0.33, 0.34, 0.34.1, 0.35, 0.35.1, 0.36, 0.36.1, 0.36.1, 0.36.2, 0.36.3, 0.37
Change logCHANGELOG.md
Dependenciesbase (<=4.11.1.0), brick, config-ini, containers, contravariant, data-clist (>=0.1), deepseq (>=1.3 && <1.5), dlist, microlens (>=0.3.0.0), microlens-mtl, microlens-th, semigroups, stm (>=2.4), template-haskell, text, text-zipper (>=0.7.1), transformers, vector, vty (>=5.18.1), word-wrap (>=0.2) [details]
LicenseBSD-3-Clause
Copyright(c) Jonathan Daugherty 2015-2018
AuthorJonathan Daugherty <cygnus@foobox.com>
MaintainerJonathan Daugherty <cygnus@foobox.com>
CategoryGraphics
Home pagehttps://github.com/jtdaugherty/brick/
Bug trackerhttps://github.com/jtdaugherty/brick/issues
Source repositoryhead: git clone git://github.com/jtdaugherty/brick.git
Executablesbrick-progressbar-demo, brick-dynamic-border-demo, brick-border-demo, brick-edit-demo, brick-hello-world-demo, brick-fill-demo, brick-custom-event-demo, brick-list-vi-demo, brick-list-demo, brick-markup-demo, brick-attr-demo, brick-theme-demo, brick-padding-demo, brick-suspend-resume-demo, brick-layer-demo, brick-mouse-demo, brick-dialog-demo, brick-viewport-scroll-demo, brick-visibility-demo, brick-cache-demo, brick-text-wrap-demo, brick-form-demo, brick-readme-demo
UploadedFri Apr 20 15:51:39 UTC 2018 by JonathanDaugherty

Modules

[Index]

Flags

NameDescriptionDefaultType
demos

Build demonstration programs

DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for brick-0.36.1

[back to package description]

Build Status

brick is a Haskell terminal user interface programming library in the style of gloss. This means you write a function that describes how your user interface should look, but the library takes care of a lot of the book-keeping that so commonly goes into writing such programs.

brick exposes a declarative API. Unlike most GUI toolkits which require you to write a long and tedious sequence of "create a widget, now bind an event handler", brick just requires you to describe your interface using a set of declarative combinators. Then you provide a function to transform your application state when input or other kinds of events arrive.

Under the hood, this library builds upon vty, so some knowledge of Vty will be helpful in using this library.

Release Announcements / News

Find out about brick releases and other news on Twitter:

https://twitter.com/brick_haskell/

Example

Here's an example interface (see programs/ReadmeDemo.hs):

withBorderStyle unicode $
borderWithLabel (str "Hello!") $
(center (str "Left") <+> vBorder <+> center (str "Right"))

Result:

┌─────────Hello!─────────┐
│           │            │
│           │            │
│   Left    │   Right    │
│           │            │
│           │            │
└────────────────────────┘

Featured Projects

To get an idea of what some people have done with brick, take a look at these projects:

Getting Started

Check out the many demo programs to get a feel for different aspects of the library:

$ cabal new-build -f demos
$ find dist-newstyle -type f -name \*-demo

To get started, see the user guide.

Documentation

Documentation for brick comes in a variety of forms:

Feature Overview

brick comes with a bunch of batteries included:

Other killer features:

Brick-Users Discussion

The brick-users Google Group / e-mail list is a place to discuss library changes, give feedback, and ask questions. You can subscribe at:

https://groups.google.com/group/brick-users

Status

There are some places were I have deliberately chosen to worry about performance later for the sake of spending more time on the design (and to wait on performance issues to arise first). brick is also something of an experimental project of mine and some aspects of the design involve trade-offs that might not be right for your application. Brick is not intended to be all things to all people; rather, I want it to provide a good foundation for building complex terminal interfaces in a declarative style to take away specific headaches of building, modifying, and working with such interfaces, all while seeing how far we can get with a pure function to specify the interface.

brick exports an extension API that makes it possible to make your own packages and widgets. If you use that, you'll also be helping to test whether the exported interface is usable and complete!

Reporting bugs

Please file bug reports as GitHub issues. For best results:

Contributing

If you decide to contribute, that's great! Here are some guidelines you should consider to make submitting patches easier for all concerned: