HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulebrick-3.0Haskell2010

Brick.Widgets.Center

This module provides combinators for centering other widgets.

Contents
  1. Centering horizontally
  2. Centering vertically
  3. Centering both horizontally and vertically
  4. Centering about an arbitrary origin
Synopsis
  • Packagebrick-3.0
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCenter.hs

Centering horizontally

valuehCenter :: Widget n -> Widget n

Center the specified widget horizontally. Consumes all available horizontal space.

valuehCenterWith :: Maybe Char -> Widget n -> Widget n

Center the specified widget horizontally. Consumes all available horizontal space. Uses the specified character to fill in the space to either side of the centered widget (defaults to space).

valuehCenterLayer :: Widget n -> Widget n

Center the specified widget horizontally using a layer translation. Consumes all available horizontal space. Unlike hCenter, this does not fill the surrounding space so it is suitable for use as a layer. Layers underneath this widget will be visible in regions surrounding the centered widget.

Centering vertically

valuevCenterWith :: Maybe Char -> Widget n -> Widget n

Center a widget vertically. Consumes all vertical space. Uses the specified character to fill in the space above and below the centered widget (defaults to space).

valuevCenterLayer :: Widget n -> Widget n

Center the specified widget vertically using a layer translation. Consumes all available vertical space. Unlike vCenter, this does not fill the surrounding space so it is suitable for use as a layer. Layers underneath this widget will be visible in regions surrounding the centered widget.

Centering both horizontally and vertically

valuecenter :: Widget n -> Widget n

Center a widget both vertically and horizontally. Consumes all available vertical and horizontal space.

valuecenterWith :: Maybe Char -> Widget n -> Widget n

Center a widget both vertically and horizontally. Consumes all available vertical and horizontal space. Uses the specified character to fill in the space around the centered widget (defaults to space).

valuecenterLayer :: Widget n -> Widget n

Center a widget both vertically and horizontally using a layer translation. Consumes all available vertical and horizontal space. Unlike center, this does not fill in the surrounding space with a character so it is usable as a layer. Any widget underneath this one will be visible in the region surrounding the centered widget.

Centering about an arbitrary origin