| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Web.View.Layout
Synopsis
- layout :: Mod c -> View c () -> View c ()
- root :: Mod c
- col :: Mod c -> View c () -> View c ()
- row :: Mod c -> View c () -> View c ()
- grow :: Mod c
- space :: View c ()
- scroll :: Mod c
- nav :: Mod c -> View c () -> View c ()
- stack :: Mod c -> Layer c () -> View c ()
- newtype Layer c a = Layer (View c a)
- layer :: Mod c -> View c () -> Layer c ()
- popup :: Sides Length -> Mod c
- hide :: Mod c
- flexRow :: Mod c
- flexCol :: Mod c
- truncate :: Mod c
Documentation
layout :: Mod c -> View c () -> View c () Source #
We can intuitively create layouts with combinations of row, col, stack, grow, and space
Wrap main content in layout to allow the view to consume vertical screen space
holygrail ::Viewc () holygrail =layoutid $ dorowsection "Top Bar"rowgrow$ docolsection "Left Sidebar"col(section .grow) "Main Content"colsection "Right Sidebar"rowsection "Bottom Bar" where section =border1
col :: Mod c -> View c () -> View c () Source #
Lay out children in a column.
col grow $ do el_ "Top" space el_ "Bottom"
row :: Mod c -> View c () -> View c () Source #
Lay out children in a row
row id $ do el_ "Left" space el_ "Right"
stack :: Mod c -> Layer c () -> View c () Source #
Stack children on top of each other. Each child has the full width. See popup
stack id $ do layer id "Background" layer (bg Black . opacity 0.5) "Overlay"
layer :: Mod c -> View c () -> Layer c () Source #
A normal layer contributes to the size of the parent. See stack
popup :: Sides Length -> Mod c Source #
This layer is not included in the stack size, and covers content outside of it. If used outside of stack, the popup is offset from the entire page.
stack id $ do
layer id $ input (value "Autocomplete Box")
layer (popup (TRBL 50 0 0 0)) $ do
el_ "Item 1"
el_ "Item 2"
el_ "Item 3"
el_ "This is covered by the menu"