Turbine.HTML.Elements
- Package
- purescript-turbine
- Repository
- funkia/purescript-turbine
This module contains Turbines DSL for constructing HTML.
This module is typically imported qualified as.
import Turbine.HTML.Elements as E
#Attributes' Source
type Attributes' r = (class :: ClassDescription, id :: Behavior String | r)
#Output' Source
type Output' r = (blur :: Stream FocusEvent, click :: Stream Unit, dblclick :: Stream Unit, keydown :: Stream KeyboardEvent, keyup :: Stream KeyboardEvent | r)
#InputAttrs Source
type InputAttrs = InputAttrs' ()
#InputOut' Source
type InputOut' r = (input :: Stream InputEvent, keyup :: Stream KeyboardEvent, value :: Behavior String | Output' + r)
#inputRange Source
inputRange :: forall a. Subrow a (InputRangeAttrs' ()) => Record a -> Component (Record ()) (Record (InputRangeOut' ()))
An input element with the type
attribute set to range
. Compared to a
normal a normal input element this variant accepts three additional
attributes all of which are numbers: max
, min
, and step
. Additionally
the value
output is a Number
and not a String
.
#inputRange_ Source
inputRange_ :: Component (Record ()) (Record (InputRangeOut' ()))
#checkbox Source
checkbox :: forall a. Subrow a CheckboxAttrs => Record a -> Component (Record ()) CheckboxOutput
#RecordOfGo Source
class RecordOfGo (xs :: RowList) (row :: Row Type) a | xs -> row a where
Members
Instances
(IsSymbol name, RowToList row rx, Cons name a trash row, RecordOfGo xs' row a) => RecordOfGo (Cons name a xs') row a
RecordOfGo Nil row a
#ClassElement Source
data ClassElement :: Type
#staticClass Source
staticClass :: String -> ClassDescription
Creates a static class from a string of space separated class names.
staticClass "foo bar baz"
#dynamicClass Source
dynamicClass :: Behavior String -> ClassDescription
Creates a dynamic class from a string valued behavior. At any point in time the element will have the class named in the behavior at that point in time.
dynamicClass "foo bar baz"
#toggleClass Source
toggleClass :: forall r. RecordOf (Behavior Boolean) r => Record r -> ClassDescription
Takes a record of boolean valued behaviors. Each key or field in the record
is interpreted as a class name. When a behavior is true
the class
corresponding to the behavior is added to the element and when it is
false
it does not exist on the element.
toggleClass
{ active: isActiveBehavior
, selected: isSelectedBehavior
}
- Modules
- Turbine
- Turbine.
HTML. Elements