Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- el :: Mod -> View c () -> View c ()
- el_ :: View c () -> View c ()
- text :: Text -> View c ()
- raw :: Text -> View c ()
- none :: View c ()
- pre :: Mod -> Text -> View c ()
- link :: Url -> Mod -> View c () -> View c ()
- form :: Mod -> View c () -> View c ()
- input :: Mod -> View c ()
- name :: Text -> Mod
- value :: Text -> Mod
- label :: Mod -> View c () -> View c ()
- button :: Mod -> View c () -> View c ()
- script :: Text -> View c ()
- style :: Text -> View c ()
- stylesheet :: Text -> View c ()
- table :: Mod -> [dt] -> Eff '[Writer [TableColumn c dt]] () -> View c ()
- tcol :: forall dt c. View (TableHead c) () -> (dt -> View dt ()) -> Eff '[Writer [TableColumn c dt]] ()
- th :: Mod -> View c () -> View (TableHead c) ()
- td :: Mod -> View () () -> View dt ()
- newtype TableHead a = TableHead a
- data TableColumn c dt = TableColumn {}
Documentation
text :: Text -> View c () Source #
Add text to a view. Not required for string literals
el_ $ do "Hello: " text user.name
raw :: Text -> View c () Source #
Embed static, unescaped HTML or SVG. Take care not to use raw
with user-generated content.
spinner = raw "<svg>...</svg>"
Inputs
Document Metadata
stylesheet :: Text -> View c () Source #
Tables
table :: Mod -> [dt] -> Eff '[Writer [TableColumn c dt]] () -> View c () Source #
Create a type safe data table by specifying columns
usersTable :: [User] -> View c () usersTable us = do table id us $ do tcol (th hd "Name") $ \u -> td cell $ text u.name tcol (th hd "Email") $ \u -> td cell $ text u.email where hd = cell . bold cell = pad 4 . border 1
tcol :: forall dt c. View (TableHead c) () -> (dt -> View dt ()) -> Eff '[Writer [TableColumn c dt]] () Source #
data TableColumn c dt Source #