Copyright | (C) 2016-2025 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Miso.Html
Description
Example usage:
import Miso data IntAction = Add | Subtract intView :: Int -> View IntAction intView n = div_ [ class_ "main" ] [ btn_ [ onClick Add ] [ text_ "+" ] , text_ $ pack (show n) , btn_ [ onClick Subtract ] [ text_ "-" ] ]
More information on how to use miso is available on GitHub
Synopsis
- a_ :: [Attribute action] -> [View action] -> View action
- abbr_ :: [Attribute action] -> [View action] -> View action
- address_ :: [Attribute action] -> [View action] -> View action
- area_ :: [Attribute action] -> [View action] -> View action
- article_ :: [Attribute action] -> [View action] -> View action
- aside_ :: [Attribute action] -> [View action] -> View action
- audio_ :: [Attribute action] -> [View action] -> View action
- b_ :: [Attribute action] -> [View action] -> View action
- base_ :: [Attribute action] -> [View action] -> View action
- bdi_ :: [Attribute action] -> [View action] -> View action
- bdo_ :: [Attribute action] -> [View action] -> View action
- blockquote_ :: [Attribute action] -> [View action] -> View action
- body_ :: [Attribute action] -> [View action] -> View action
- br_ :: [Attribute action] -> View action
- button_ :: [Attribute action] -> [View action] -> View action
- canvas_ :: [Attribute action] -> [View action] -> View action
- caption_ :: [Attribute action] -> [View action] -> View action
- cite_ :: [Attribute action] -> [View action] -> View action
- code_ :: [Attribute action] -> [View action] -> View action
- col_ :: [Attribute action] -> View action
- colgroup_ :: [Attribute action] -> [View action] -> View action
- datalist_ :: [Attribute action] -> [View action] -> View action
- dd_ :: [Attribute action] -> [View action] -> View action
- del_ :: [Attribute action] -> [View action] -> View action
- details_ :: [Attribute action] -> [View action] -> View action
- dfn_ :: [Attribute action] -> [View action] -> View action
- dialog_ :: [Attribute action] -> [View action] -> View action
- div_ :: [Attribute action] -> [View action] -> View action
- dl_ :: [Attribute action] -> [View action] -> View action
- doctype_ :: View action
- dt_ :: [Attribute action] -> [View action] -> View action
- em_ :: [Attribute action] -> [View action] -> View action
- embed_ :: [Attribute action] -> View action
- fencedframe_ :: [Attribute action] -> [View action] -> View action
- fieldset_ :: [Attribute action] -> [View action] -> View action
- figcaption_ :: [Attribute action] -> [View action] -> View action
- figure_ :: [Attribute action] -> [View action] -> View action
- footer_ :: [Attribute action] -> [View action] -> View action
- form :: [Attribute action] -> [View action] -> View action
- h1_ :: [Attribute action] -> [View action] -> View action
- h2_ :: [Attribute action] -> [View action] -> View action
- h3_ :: [Attribute action] -> [View action] -> View action
- h4_ :: [Attribute action] -> [View action] -> View action
- h5_ :: [Attribute action] -> [View action] -> View action
- h6_ :: [Attribute action] -> [View action] -> View action
- head_ :: [Attribute action] -> [View action] -> View action
- header_ :: [Attribute action] -> [View action] -> View action
- hgroup_ :: [Attribute action] -> [View action] -> View action
- hr_ :: [Attribute action] -> View action
- html_ :: [Attribute action] -> [View action] -> View action
- i_ :: [Attribute action] -> [View action] -> View action
- iframe_ :: [Attribute action] -> [View action] -> View action
- img_ :: [Attribute action] -> View action
- input_ :: [Attribute action] -> View action
- ins_ :: [Attribute action] -> [View action] -> View action
- kbd_ :: [Attribute action] -> [View action] -> View action
- label_ :: [Attribute action] -> [View action] -> View action
- legend_ :: [Attribute action] -> [View action] -> View action
- li_ :: [Attribute action] -> [View action] -> View action
- link_ :: [Attribute action] -> View action
- main_ :: [Attribute action] -> [View action] -> View action
- map_ :: [Attribute action] -> [View action] -> View action
- mark_ :: [Attribute action] -> [View action] -> View action
- menu_ :: [Attribute action] -> [View action] -> View action
- meta_ :: [Attribute action] -> View action
- meter_ :: [Attribute action] -> [View action] -> View action
- nav_ :: [Attribute action] -> [View action] -> View action
- nodeHtml :: MisoString -> [Attribute action] -> [View action] -> View action
- noscript_ :: [Attribute action] -> [View action] -> View action
- object_ :: [Attribute action] -> [View action] -> View action
- ol_ :: [Attribute action] -> [View action] -> View action
- optgroup_ :: [Attribute action] -> [View action] -> View action
- option_ :: [Attribute action] -> [View action] -> View action
- output_ :: [Attribute action] -> [View action] -> View action
- p_ :: [Attribute action] -> [View action] -> View action
- picture_ :: [Attribute action] -> [View action] -> View action
- pre_ :: [Attribute action] -> [View action] -> View action
- progress_ :: [Attribute action] -> [View action] -> View action
- q_ :: [Attribute action] -> [View action] -> View action
- rp_ :: [Attribute action] -> [View action] -> View action
- rt_ :: [Attribute action] -> [View action] -> View action
- ruby_ :: [Attribute action] -> [View action] -> View action
- s_ :: [Attribute action] -> [View action] -> View action
- samp_ :: [Attribute action] -> [View action] -> View action
- script_ :: [Attribute action] -> MisoString -> View action
- search_ :: [Attribute action] -> [View action] -> View action
- section_ :: [Attribute action] -> [View action] -> View action
- select_ :: [Attribute action] -> [View action] -> View action
- slot_ :: [Attribute action] -> [View action] -> View action
- small_ :: [Attribute action] -> [View action] -> View action
- source_ :: [Attribute action] -> View action
- span_ :: [Attribute action] -> [View action] -> View action
- strong_ :: [Attribute action] -> [View action] -> View action
- style_ :: [Attribute action] -> MisoString -> View action
- sub_ :: [Attribute action] -> [View action] -> View action
- summary_ :: [Attribute action] -> [View action] -> View action
- sup_ :: [Attribute action] -> [View action] -> View action
- table_ :: [Attribute action] -> [View action] -> View action
- tbody_ :: [Attribute action] -> [View action] -> View action
- td_ :: [Attribute action] -> [View action] -> View action
- template_ :: [Attribute action] -> [View action] -> View action
- textarea_ :: [Attribute action] -> [View action] -> View action
- tfoot_ :: [Attribute action] -> [View action] -> View action
- th_ :: [Attribute action] -> [View action] -> View action
- thead_ :: [Attribute action] -> [View action] -> View action
- time_ :: [Attribute action] -> [View action] -> View action
- tr_ :: [Attribute action] -> [View action] -> View action
- track_ :: [Attribute action] -> View action
- u_ :: [Attribute action] -> [View action] -> View action
- ul_ :: [Attribute action] -> [View action] -> View action
- var_ :: [Attribute action] -> [View action] -> View action
- video_ :: [Attribute action] -> [View action] -> View action
- wbr_ :: [Attribute action] -> View action
- module Miso.Html.Property
- module Miso.Html.Event
- module Miso.Html.Types
Elements
form :: [Attribute action] -> [View action] -> View action Source #
For usage in a real-world application with the onSubmit
event.
view :: Model -> View action view model = form [ onSubmit NoOp ] [ input [ type_ "submit" ] ]
Note: onSubmit
will use preventDefault = True
. This will keep
the form from submitting to the server.
script_ :: [Attribute action] -> MisoString -> View action Source #
This takes the raw text to be put in the script tag.
That means that if any part of the text is not trusted there's a potential JavaScript injection. Read more at https://owasp.org/www-community/attacks/xss/
You can also easily shoot yourself in the foot with something like:
script_
[] "</script>"
style_ :: [Attribute action] -> MisoString -> View action Source #
This takes the raw text to be put in the style tag.
That means that if any part of the text is not trusted there's a potential CSS injection. Read more at https://owasp.org/www-project-web-security-testing-guide/stable/4-Web_Application_Security_Testing/11-Client-side_Testing/05-Testing_for_CSS_Injection
You can also easily shoot yourself in the foot with something like:
style_
[] "</style>"
Attributes
module Miso.Html.Property
Events
module Miso.Html.Event
Virtual DOM
module Miso.Html.Types