danielnarey/elm-semantic-dom/1.1.0

NOTE: this package is not compatible with Elm 0.19.1

Dom.Node

Construct native VirtualDom nodes

Using the constructors in this module is the more efficient way of building your Elm program's Dom, but unlike Dom.Element records, native VirtualDom nodes cannot be modified (within an Elm program) after they are constructed.

leaf : String -> List (Property msg) -> Node msg

Construct a leaf node (a node without children); the first argument gives the tag and the second argument gives a list of attributes

This function is an alias for VirtualDom.node with an empty list of child nodes.

Dom.Node.leaf "hr" []
textWrapper : String -> List (Property msg) -> String -> Node msg

Construct a node that wraps text; the first argument gives the tag, the second argument gives a list of attributes, and the third argument gives the internal text

This function is an alias for VirtualDom.node with a single text node as the only child.

"Hello World!"
  |> Dom.Node.textWrapper "p" []
container : String -> List (Property msg) -> List (Node msg) -> Node msg

Construct a node that contains other nodes; the first argument gives the tag, the second argument gives a list of attributes, and the third argument gives a list of child nodes

This function is just an alias for VirtualDom.node.

[ "Hello World!"
  |> Dom.Node.textWrapper "p" []
]
  |> Dom.Node.container "div" []