Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Documentation
layout :: Mod -> View c () -> View c () Source #
We can intuitively create layouts with combindations of row
, col
, grow
, and space
Wrap main content in layout
to allow the view to consume vertical screen space
holygrail ::View
c () holygrail =layout
id $ dorow
section "Top Bar"row
grow
$ docol
section "Left Sidebar"col
(section .grow
) "Main Content"col
section "Right Sidebar"row
section "Bottom Bar" where section =border
1
col :: Mod -> View c () -> View c () Source #
Lay out children in a column.
col grow $ do el_ "Top" space el_ "Bottom"
row :: Mod -> View c () -> View c () Source #
Lay out children in a row
row id $ do el_ "Left" space el_ "Right"
Allow items to become smaller than their contents. This is not the opposite of grow!