Module

Halogen.HTML

Package
purescript-halogen
Repository
purescript-halogen/purescript-halogen

This module re-exports the types for the HTML DSL, and values for all supported HTML elements.

#ComponentHTML Source

type ComponentHTML action slots m = HTML (ComponentSlot slots m action) action

A convenience synonym for the output type of a render function for a component that renders HTML.

  • action is the type of actions, events internal to the component that can be evaluated with the handleAction function
  • slots is the set of child component types that can be used in the HTML
  • m is the monad used by the child component during evaluation

#PlainHTML Source

type PlainHTML = HTML Void Void

A type useful for a chunk of HTML with no slot-embedding or query-raising.

Often a polymorphic usage of HTML is good enough for this, but sometimes it's useful to have a type like this (and accompanying coercion) when doing things like creating components that accept a chunk of HTML as part of their configuration.

#fromPlainHTML Source

fromPlainHTML :: forall w i. PlainHTML -> HTML w i

Relaxes the type of PlainHTML to make it compatible with all HTML.

#slot Source

slot :: forall query action input output slots m label slot _1. Cons label (Slot query output slot) _1 slots => IsSymbol label => Ord slot => Proxy label -> slot -> Component query input output m -> input -> (output -> action) -> ComponentHTML action slots m

Defines a slot for a child component. Takes:

  • the slot address label
  • the slot address index
  • the component for the slot
  • the input value to pass to the component
  • a function mapping outputs from the component to a query in the parent

#slot_ Source

slot_ :: forall query action input output slots m label slot _1. Cons label (Slot query output slot) _1 slots => IsSymbol label => Ord slot => Proxy label -> slot -> Component query input output m -> input -> ComponentHTML action slots m

Defines a slot for a child component, ignoring its output.

This variant may be used when the component produces output, but it is not needed in the current context, or instead of passing absurd to slot when the output type is Void.

Takes:

  • the slot address label
  • the slot address index
  • the component for the slot
  • the input value to pass to the component

#memoized Source

memoized :: forall a action slots m. (a -> a -> Boolean) -> (a -> ComponentHTML action slots m) -> a -> ComponentHTML action slots m

Optimizes rendering of a subtree given an equality predicate. If an argument is deemed equivalent to the previous value, rendering and diffing will be skipped. You should not use this function fully saturated, but instead partially apply it for use within a Component's scope. For example, to skip rendering for equal states, just wrap your render function.

myComponent = component
 { render: memoized eq render
 , ...
 }

#lazy Source

lazy :: forall a action slots m. (a -> ComponentHTML action slots m) -> a -> ComponentHTML action slots m

Skips rendering for referentially equal arguments. You should not use this function fully saturated, but instead partially apply it for use within a Component's scope.

#lazy2 Source

lazy2 :: forall a b action slots m. (a -> b -> ComponentHTML action slots m) -> a -> b -> ComponentHTML action slots m

Like lazy, but for a rendering function which takes 2 arguments.

#lazy3 Source

lazy3 :: forall a b c action slots m. (a -> b -> c -> ComponentHTML action slots m) -> a -> b -> c -> ComponentHTML action slots m

Like lazy, but for a rendering function which takes 3 arguments.

Re-exports from Halogen.HTML.Core

#PropName Source

newtype PropName value

Constructors

Instances

#HTML Source

newtype HTML w i

Constructors

Instances

#ElemName Source

#ClassName Source

newtype ClassName

A wrapper for strings which are used as CSS classes.

Constructors

Instances

#AttrName Source

newtype AttrName

A wrapper for attribute names.

Constructors

Instances

#text Source

text :: forall w i. String -> HTML w i

Constructs a text node HTML value.

#handler Source

handler :: forall i. EventType -> (Event -> Maybe i) -> Prop i

Create an event handler.

Re-exports from Halogen.HTML.Elements

#Node Source

type Node r w i = Array (IProp r i) -> Array (HTML w i) -> HTML w i

An HTML element that admits children.

#Leaf Source

type Leaf r w i = Array (IProp r i) -> HTML w i

An HTML element that does not admit children.

#withKeys_ Source

withKeys_ :: forall w i. (Array (HTML w i) -> HTML w i) -> Array (Tuple String (HTML w i)) -> HTML w i

#withKeys Source

withKeys :: forall r w i. (Array (IProp r i) -> Array (HTML w i) -> HTML w i) -> Array (IProp r i) -> Array (Tuple String (HTML w i)) -> HTML w i

#wbr Source

wbr :: forall w i. Leaf HTMLwbr w i

#video_ Source

video_ :: forall w i. Array (HTML w i) -> HTML w i

#video Source

video :: forall w i. Node HTMLvideo w i

#var_ Source

var_ :: forall w i. Array (HTML w i) -> HTML w i

#var Source

var :: forall w i. Node HTMLvar w i

#ul_ Source

ul_ :: forall w i. Array (HTML w i) -> HTML w i

#ul Source

ul :: forall w i. Node HTMLul w i

#u_ Source

u_ :: forall w i. Array (HTML w i) -> HTML w i

#u Source

u :: forall w i. Node HTMLu w i

#track Source

track :: forall w i. Leaf HTMLtrack w i

#tr_ Source

tr_ :: forall w i. Array (HTML w i) -> HTML w i

#tr Source

tr :: forall w i. Node HTMLtr w i

#title_ Source

title_ :: forall w i. Array (HTML w i) -> HTML w i

#title Source

title :: forall w i. Node HTMLtitle w i

#time_ Source

time_ :: forall w i. Array (HTML w i) -> HTML w i

#time Source

time :: forall w i. Node HTMLtime w i

#thead_ Source

thead_ :: forall w i. Array (HTML w i) -> HTML w i

#thead Source

thead :: forall w i. Node HTMLthead w i

#th_ Source

th_ :: forall w i. Array (HTML w i) -> HTML w i

#th Source

th :: forall w i. Node HTMLth w i

#tfoot_ Source

tfoot_ :: forall w i. Array (HTML w i) -> HTML w i

#tfoot Source

tfoot :: forall w i. Node HTMLtfoot w i

#textarea Source

textarea :: forall w i. Leaf HTMLtextarea w i

#td_ Source

td_ :: forall w i. Array (HTML w i) -> HTML w i

#td Source

td :: forall w i. Node HTMLtd w i

#tbody_ Source

tbody_ :: forall w i. Array (HTML w i) -> HTML w i

#tbody Source

tbody :: forall w i. Node HTMLtbody w i

#table_ Source

table_ :: forall w i. Array (HTML w i) -> HTML w i

#table Source

table :: forall w i. Node HTMLtable w i

#sup_ Source

sup_ :: forall w i. Array (HTML w i) -> HTML w i

#sup Source

sup :: forall w i. Node HTMLsup w i

#summary_ Source

summary_ :: forall w i. Array (HTML w i) -> HTML w i

#summary Source

summary :: forall w i. Node HTMLsummary w i

#sub_ Source

sub_ :: forall w i. Array (HTML w i) -> HTML w i

#sub Source

sub :: forall w i. Node HTMLsub w i

#style_ Source

style_ :: forall w i. Array (HTML w i) -> HTML w i

#style Source

style :: forall w i. Node HTMLstyle w i

#strong_ Source

strong_ :: forall w i. Array (HTML w i) -> HTML w i

#strong Source

strong :: forall w i. Node HTMLstrong w i

#span_ Source

span_ :: forall w i. Array (HTML w i) -> HTML w i

#span Source

span :: forall w i. Node HTMLspan w i

#source Source

source :: forall w i. Leaf HTMLsource w i

#small_ Source

small_ :: forall w i. Array (HTML w i) -> HTML w i

#small Source

small :: forall w i. Node HTMLsmall w i

#select_ Source

select_ :: forall w i. Array (HTML w i) -> HTML w i

#select Source

select :: forall w i. Node HTMLselect w i

#section_ Source

section_ :: forall w i. Array (HTML w i) -> HTML w i

#section Source

section :: forall w i. Node HTMLsection w i

#script_ Source

script_ :: forall w i. Array (HTML w i) -> HTML w i

#script Source

script :: forall w i. Node HTMLscript w i

#samp_ Source

samp_ :: forall w i. Array (HTML w i) -> HTML w i

#samp Source

samp :: forall w i. Node HTMLsamp w i

#ruby_ Source

ruby_ :: forall w i. Array (HTML w i) -> HTML w i

#ruby Source

ruby :: forall w i. Node HTMLruby w i

#rt_ Source

rt_ :: forall w i. Array (HTML w i) -> HTML w i

#rt Source

rt :: forall w i. Node HTMLrt w i

#rp_ Source

rp_ :: forall w i. Array (HTML w i) -> HTML w i

#rp Source

rp :: forall w i. Node HTMLrp w i

#q_ Source

q_ :: forall w i. Array (HTML w i) -> HTML w i

#q Source

q :: forall w i. Node HTMLq w i

#progress_ Source

progress_ :: forall w i. Array (HTML w i) -> HTML w i

#progress Source

progress :: forall w i. Node HTMLprogress w i

#pre_ Source

pre_ :: forall w i. Array (HTML w i) -> HTML w i

#pre Source

pre :: forall w i. Node HTMLpre w i

#param Source

param :: forall w i. Leaf HTMLparam w i

#p_ Source

p_ :: forall w i. Array (HTML w i) -> HTML w i

#p Source

p :: forall w i. Node HTMLp w i

#output_ Source

output_ :: forall w i. Array (HTML w i) -> HTML w i

#output Source

output :: forall w i. Node HTMLoutput w i

#option_ Source

option_ :: forall w i. Array (HTML w i) -> HTML w i

#option Source

option :: forall w i. Node HTMLoption w i

#optgroup_ Source

optgroup_ :: forall w i. Array (HTML w i) -> HTML w i

#optgroup Source

optgroup :: forall w i. Node HTMLoptgroup w i

#ol_ Source

ol_ :: forall w i. Array (HTML w i) -> HTML w i

#ol Source

ol :: forall w i. Node HTMLol w i

#object_ Source

object_ :: forall w i. Array (HTML w i) -> HTML w i

#object Source

object :: forall w i. Node HTMLobject w i

#noscript_ Source

noscript_ :: forall w i. Array (HTML w i) -> HTML w i

#noscript Source

noscript :: forall w i. Node HTMLnoscript w i

#nav_ Source

nav_ :: forall w i. Array (HTML w i) -> HTML w i

#nav Source

nav :: forall w i. Node HTMLnav w i

#meter_ Source

meter_ :: forall w i. Array (HTML w i) -> HTML w i

#meter Source

meter :: forall w i. Node HTMLmeter w i

#meta Source

meta :: forall w i. Leaf HTMLmeta w i

#menuitem_ Source

menuitem_ :: forall w i. Array (HTML w i) -> HTML w i

#menuitem Source

menuitem :: forall w i. Node HTMLmenuitem w i

#menu_ Source

menu_ :: forall w i. Array (HTML w i) -> HTML w i

#menu Source

menu :: forall w i. Node HTMLmenu w i

#mark_ Source

mark_ :: forall w i. Array (HTML w i) -> HTML w i

#mark Source

mark :: forall w i. Node HTMLmark w i

#map_ Source

map_ :: forall w i. Array (HTML w i) -> HTML w i

#map Source

map :: forall w i. Node HTMLmap w i

#main_ Source

main_ :: forall w i. Array (HTML w i) -> HTML w i

#main Source

main :: forall w i. Node HTMLmain w i

#li_ Source

li_ :: forall w i. Array (HTML w i) -> HTML w i

#li Source

li :: forall w i. Node HTMLli w i

#legend_ Source

legend_ :: forall w i. Array (HTML w i) -> HTML w i

#legend Source

legend :: forall w i. Node HTMLlegend w i

#label_ Source

label_ :: forall w i. Array (HTML w i) -> HTML w i

#label Source

label :: forall w i. Node HTMLlabel w i

#keyedNS Source

keyedNS :: forall r w i. Namespace -> ElemName -> Array (IProp r i) -> Array (Tuple String (HTML w i)) -> HTML w i

Creates a Namespaced HTML element that expects indexed properties, with keyed children.

#keyed Source

keyed :: forall r w i. ElemName -> Array (IProp r i) -> Array (Tuple String (HTML w i)) -> HTML w i

Creates an HTML element that expects indexed properties, with keyed children.

#kbd_ Source

kbd_ :: forall w i. Array (HTML w i) -> HTML w i

#kbd Source

kbd :: forall w i. Node HTMLkbd w i

#ins_ Source

ins_ :: forall w i. Array (HTML w i) -> HTML w i

#ins Source

ins :: forall w i. Node HTMLins w i

#input Source

input :: forall w i. Leaf HTMLinput w i

#img Source

img :: forall w i. Leaf HTMLimg w i

#iframe Source

iframe :: forall w i. Leaf HTMLiframe w i

#i_ Source

i_ :: forall w i. Array (HTML w i) -> HTML w i

#i Source

i :: forall w i. Node HTMLi w i

#html_ Source

html_ :: forall w i. Array (HTML w i) -> HTML w i

#html Source

html :: forall w i. Node HTMLhtml w i

#hr_ Source

hr_ :: forall w i. HTML w i

#hr Source

hr :: forall w i. Leaf HTMLhr w i

#header_ Source

header_ :: forall w i. Array (HTML w i) -> HTML w i

#header Source

header :: forall w i. Node HTMLheader w i

#head_ Source

head_ :: forall w i. Array (HTML w i) -> HTML w i

#head Source

head :: forall w i. Node HTMLhead w i

#h6_ Source

h6_ :: forall w i. Array (HTML w i) -> HTML w i

#h6 Source

h6 :: forall w i. Node HTMLh6 w i

#h5_ Source

h5_ :: forall w i. Array (HTML w i) -> HTML w i

#h5 Source

h5 :: forall w i. Node HTMLh5 w i

#h4_ Source

h4_ :: forall w i. Array (HTML w i) -> HTML w i

#h4 Source

h4 :: forall w i. Node HTMLh4 w i

#h3_ Source

h3_ :: forall w i. Array (HTML w i) -> HTML w i

#h3 Source

h3 :: forall w i. Node HTMLh3 w i

#h2_ Source

h2_ :: forall w i. Array (HTML w i) -> HTML w i

#h2 Source

h2 :: forall w i. Node HTMLh2 w i

#h1_ Source

h1_ :: forall w i. Array (HTML w i) -> HTML w i

#h1 Source

h1 :: forall w i. Node HTMLh1 w i

#form_ Source

form_ :: forall w i. Array (HTML w i) -> HTML w i

#form Source

form :: forall w i. Node HTMLform w i

#footer_ Source

footer_ :: forall w i. Array (HTML w i) -> HTML w i

#footer Source

footer :: forall w i. Node HTMLfooter w i

#figure_ Source

figure_ :: forall w i. Array (HTML w i) -> HTML w i

#figure Source

figure :: forall w i. Node HTMLfigure w i

#figcaption_ Source

figcaption_ :: forall w i. Array (HTML w i) -> HTML w i

#figcaption Source

figcaption :: forall w i. Node HTMLfigcaption w i

#fieldset_ Source

fieldset_ :: forall w i. Array (HTML w i) -> HTML w i

#fieldset Source

fieldset :: forall w i. Node HTMLfieldset w i

#embed_ Source

embed_ :: forall w i. Array (HTML w i) -> HTML w i

#embed Source

embed :: forall w i. Node HTMLembed w i

#em_ Source

em_ :: forall w i. Array (HTML w i) -> HTML w i

#em Source

em :: forall w i. Node HTMLem w i

#elementNS Source

elementNS :: forall r w i. Namespace -> ElemName -> Array (IProp r i) -> Array (HTML w i) -> HTML w i

Creates a Namespaced HTML element that expects indexed properties.

#element Source

element :: forall r w i. ElemName -> Array (IProp r i) -> Array (HTML w i) -> HTML w i

Creates an HTML element that expects indexed properties.

#dt_ Source

dt_ :: forall w i. Array (HTML w i) -> HTML w i

#dt Source

dt :: forall w i. Node (HTMLdt) w i

#dl_ Source

dl_ :: forall w i. Array (HTML w i) -> HTML w i

#dl Source

dl :: forall w i. Node HTMLdl w i

#div_ Source

div_ :: forall w i. Array (HTML w i) -> HTML w i

#div Source

div :: forall w i. Node HTMLdiv w i

#dialog_ Source

dialog_ :: forall w i. Array (HTML w i) -> HTML w i

#dialog Source

dialog :: forall w i. Node HTMLdialog w i

#dfn_ Source

dfn_ :: forall w i. Array (HTML w i) -> HTML w i

#dfn Source

dfn :: forall w i. Node HTMLdfn w i

#details_ Source

details_ :: forall w i. Array (HTML w i) -> HTML w i

#details Source

details :: forall w i. Node HTMLdetails w i

#del_ Source

del_ :: forall w i. Array (HTML w i) -> HTML w i

#del Source

del :: forall w i. Node HTMLdel w i

#dd_ Source

dd_ :: forall w i. Array (HTML w i) -> HTML w i

#dd Source

dd :: forall w i. Node HTMLdd w i

#datalist_ Source

datalist_ :: forall w i. Array (HTML w i) -> HTML w i

#datalist Source

datalist :: forall w i. Node HTMLdatalist w i

#command Source

command :: forall w i. Leaf HTMLcommand w i

#colgroup_ Source

colgroup_ :: forall w i. Array (HTML w i) -> HTML w i

#colgroup Source

colgroup :: forall w i. Node HTMLcolgroup w i

#col Source

col :: forall w i. Leaf HTMLcol w i

#code_ Source

code_ :: forall w i. Array (HTML w i) -> HTML w i

#code Source

code :: forall w i. Node HTMLcode w i

#cite_ Source

cite_ :: forall w i. Array (HTML w i) -> HTML w i

#cite Source

cite :: forall w i. Node HTMLcite w i

#caption_ Source

caption_ :: forall w i. Array (HTML w i) -> HTML w i

#caption Source

caption :: forall w i. Node HTMLcaption w i

#canvas Source

canvas :: forall w i. Leaf HTMLcanvas w i

#button_ Source

button_ :: forall w i. Array (HTML w i) -> HTML w i

#button Source

button :: forall w i. Node HTMLbutton w i

#br_ Source

br_ :: forall w i. HTML w i

#br Source

br :: forall w i. Leaf HTMLbr w i

#body_ Source

body_ :: forall w i. Array (HTML w i) -> HTML w i

#body Source

body :: forall w i. Node HTMLbody w i

#blockquote_ Source

blockquote_ :: forall w i. Array (HTML w i) -> HTML w i

#blockquote Source

blockquote :: forall w i. Node HTMLblockquote w i

#bdo_ Source

bdo_ :: forall w i. Array (HTML w i) -> HTML w i

#bdo Source

bdo :: forall w i. Node HTMLbdo w i

#bdi_ Source

bdi_ :: forall w i. Array (HTML w i) -> HTML w i

#bdi Source

bdi :: forall w i. Node HTMLbdi w i

#base Source

base :: forall w i. Leaf HTMLbase w i

#b_ Source

b_ :: forall w i. Array (HTML w i) -> HTML w i

#b Source

b :: forall w i. Node HTMLb w i

#audio_ Source

audio_ :: forall w i. Array (HTML w i) -> HTML w i

#audio Source

audio :: forall w i. Node HTMLaudio w i

#aside_ Source

aside_ :: forall w i. Array (HTML w i) -> HTML w i

#aside Source

aside :: forall w i. Node HTMLaside w i

#article_ Source

article_ :: forall w i. Array (HTML w i) -> HTML w i

#article Source

article :: forall w i. Node HTMLarticle w i

#area Source

area :: forall w i. Leaf HTMLarea w i

#address_ Source

address_ :: forall w i. Array (HTML w i) -> HTML w i

#address Source

address :: forall w i. Node HTMLaddress w i

#abbr_ Source

abbr_ :: forall w i. Array (HTML w i) -> HTML w i

#abbr Source

abbr :: forall w i. Node HTMLabbr w i

#a_ Source

a_ :: forall w i. Array (HTML w i) -> HTML w i

#a Source

a :: forall w i. Node HTMLa w i

Re-exports from Halogen.HTML.Properties

#IProp Source

newtype IProp (r :: Row Type) i

The phantom row r can be thought of as a context which is synthesized in the course of constructing a refined HTML expression.

Instances

#prop Source

prop :: forall value r i. IsProp value => PropName value -> value -> IProp r i

Creates an indexed HTML property.

#attrNS Source

attrNS :: forall r i. Namespace -> AttrName -> String -> IProp r i

Creates an indexed HTML attribute.

#attr Source

attr :: forall r i. AttrName -> String -> IProp r i

Creates an indexed HTML attribute.