lipstick-brick: Show lipstick blocks in brick and vty applications

[ console, library, mit, user-interfaces ] [ Propose Tags ] [ Report a vulnerability ]

Turn lipstick blocks into vty images and brick widgets, so styles, tables, lists and trees made with lipstick can be shown in terminal user interfaces.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.20 && <4.23), brick (>=2.7 && <3.1), lipstick (>=0.1.0.0 && <0.2), microlens (>=0.4 && <0.6), text (>=2.1 && <2.2), vty (>=6.2 && <6.7) [details]
Tested with ghc ==9.10.3 || ==9.12.2 || ==9.14.1
License MIT
Author Andrea Bedini
Maintainer andrea@bedini.au
Uploaded by andreabedini at 2026-11-09T09:46:15Z
Category Console, User Interfaces
Home page https://github.com/andreabedini/lipstick
Bug tracker https://github.com/andreabedini/lipstick/issues
Source repo head: git clone https://github.com/andreabedini/lipstick.git(lipstick-brick)
Distributions
Downloads 0 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for lipstick-brick-0.1.0.0

[back to package description]

lipstick-brick

Show lipstick blocks in brick and vty applications, so the styles, tables, lists and trees made with lipstick can be used in terminal user interfaces.

{-# LANGUAGE OverloadedStrings #-}
import Brick (Widget)
import Lipstick
import Lipstick.Brick

ui :: Widget ()
ui = blockWidget defaultRenderEnv (render (border roundedBorder <> padding 1 2) "Hello")
  • blockWidget lays a block out in the width brick gives it. The widget is greedy horizontally when the block grows (fillWidth), and fixed otherwise.

  • blockImage gives a vty image of a block, laid out in the width of the RenderEnv.

  • profileForColorMode gives the lipstick colour profile matching a vty output's colour mode, so colours are resolved for what the terminal can show:

    env = defaultRenderEnv {envProfile = profileForColorMode (outputColorMode (outputIface vty))}
    

vty measures text with its own width tables, which can disagree with lipstick's for some emoji; layouts made of such characters may be off by a column.

Licence

MIT, see LICENSE.