bcardiff/elm-rad/1.0.0

Rad.View

The HTML view engine and its primitives.

type Attribute model

An attribute applied to an HTML primitive. Encodes reactive intent (bind, bindDebounced, onClick) that htmlEngine wires into real Html.Attributes at render time.

type HtmlView model

The HTML view value.

= OnEnter
| OnBlur
| OnTimeout

A commit trigger for debounced bindings.

bind : Cell String -> Attribute model

Two-way bind an input's value to a Cell String.

bindDebounced : DebouncedCell String -> Attribute model

Bind an input to a DebouncedCell String with all commit triggers enabled (OnEnter, OnBlur, OnTimeout) — the common debounce case.

bindDebouncedWith : List CommitTrigger -> DebouncedCell String -> Attribute model

Bind an input to a DebouncedCell String with a custom set of commit triggers. The empty list is a valid escape hatch: no view trigger commits; the only paths to settled are explicit commit / revert actions.

onClick : Action model -> Attribute model

Dispatch an action when an element is clicked.

button : List (Attribute model) -> List (HtmlView model) -> HtmlView model

An HTML <button>.

col : List (Attribute model) -> List (HtmlView model) -> HtmlView model

A vertical stack.

input : List (Attribute model) -> List (HtmlView model) -> HtmlView model

An HTML <input />.

text : String -> HtmlView model

Plain text.

watch : Source a -> (a -> HtmlView model) -> HtmlView model

Subscribe a view region to a source.

htmlEngine : ViewEngine (HtmlView model) model

The shipped HTML engine.