Module

Pha.Html.Core

Package
purescript-pha
Repository
gbagan/purescript-pha

#EventHandler Source

type EventHandler msg = Event -> Effect (Maybe msg)

#Html Source

data Html t0

Instances

#KeyedHtml Source

type KeyedHtml a = { html :: Html a, key :: String }

#Prop Source

data Prop t0

Instances

#elem Source

elem :: forall msg. String -> Array (Prop msg) -> Array (Html msg) -> Html msg

Create a HTML element.

#keyed Source

keyed :: forall msg. String -> Array (Prop msg) -> Array (KeyedHtml msg) -> Html msg

Create a HTML element where children are keyed.

#text Source

text :: forall msg. String -> Html msg

Create a text node HTML value.

#attr Source

attr :: forall msg. String -> String -> Prop msg

Create a HTML attribute.

#prop Source

prop :: forall msg value. String -> value -> Prop msg

Create a HTML property.

#noProp Source

noProp :: forall msg. Prop msg

#style Source

style :: forall msg. String -> String -> Prop msg

Create a CSS property.

#class_ Source

class_ :: forall msg. String -> Prop msg

Create a CSS class.

#class' Source

class' :: forall msg. String -> Boolean -> Prop msg

Create a CSS class if the boolean is True.

#empty Source

empty :: forall msg. Html msg

Create a empty HTML value.

#lazy Source

lazy :: forall a msg. (a -> Html msg) -> a -> Html msg

Creates a lazy node.

Lazy nodes are only updated if the parameter changes (compared by reference)

#lazy2 Source

lazy2 :: forall a b msg. (a -> b -> Html msg) -> a -> b -> Html msg

Same as lazy but checks on two arguments.

#lazy3 Source

lazy3 :: forall a b c msg. (a -> b -> c -> Html msg) -> a -> b -> c -> Html msg

Same as lazy but checks on three arguments.

#lazy4 Source

lazy4 :: forall a b c d msg. (a -> b -> c -> d -> Html msg) -> a -> b -> c -> d -> Html msg

Same as lazy but checks on four arguments.

#lazy5 Source

lazy5 :: forall a b c d e msg. (a -> b -> c -> d -> e -> Html msg) -> a -> b -> c -> d -> e -> Html msg

Same as lazy but checks on five arguments.

#when Source

when :: forall msg. Boolean -> (Unit -> Html msg) -> Html msg

Create a VDOM tree only if the boolean is True

#fromMaybe Source

fromMaybe :: forall msg. Maybe (Html msg) -> Html msg
fromMaybe (Just html) = html
fromMaybe Nothing = empty

#maybe Source

maybe :: forall a msg. Maybe a -> (a -> Html msg) -> Html msg

#on_ Source

on_ :: forall msg. String -> (Event -> Maybe msg) -> Prop msg

#unsafeOnWithEffect Source

unsafeOnWithEffect :: forall msg. String -> EventHandler msg -> Prop msg

Re-exports from Web.Event.Event

#Event Source

data Event

Basic type for all DOM events.