Module

Bonsai.Html.Attributes

Package
purescript-bonsai
Repository
grmble/purescript-bonsai

Bonsai HTML Attribute Helpers

Mostly transcribed from Elm with omissions - only the most frequently used.

#style Source

style :: String -> String -> Style

Create a style fragment for the Element DSL

#classList Source

classList :: forall msg. Array (Tuple String Boolean) -> Property msg

Sets space-separated class attributes for CSS

#cls Source

cls :: forall msg. String -> Property msg

Set the elements class for CSS. Also class_

#class_ Source

class_ :: forall msg. String -> Property msg

Set the elements class for CSS. Also class_

#id_ Source

id_ :: forall msg. String -> Property msg

Set the element's ID. Also id

#id Source

id :: forall msg. String -> Property msg

Set the element's ID. Also id_

#hidden Source

hidden :: forall msg. Boolean -> Property msg

Hide or show the element

#title Source

title :: forall msg. String -> Property msg

Text that will displayed in a tooltip when hovering over the element

#typ Source

typ :: forall msg. String -> Property msg

Defines the type of a button, input, or ...

#type_ Source

type_ :: forall msg. String -> Property msg

Defines the type of a button, input, or ...

#value Source

value :: forall msg. String -> Property msg

Defines a (default) value which will be displayed in a button, option, input, ...

#defaultValue Source

defaultValue :: forall msg. String -> Property msg

Defines an initial value which will be displayed in an input when it is added to the DOM. Unlike value, changing defaultValue after the input has been added to the DOM has no effect.

#checked Source

checked :: forall msg. Boolean -> Property msg

Indicates if a checkbox is checked.

#placeholder Source

placeholder :: forall msg. String -> Property msg

Provide a hint to the user what can be entered in an input or textarea

#selected Source

selected :: forall msg. Boolean -> Property msg

defines which option will be selected on page load.

#autocomplete Source

autocomplete :: forall msg. Boolean -> Property msg

Indicates if a form or input can have their values automatically completed by the browser.

#autofocus Source

autofocus :: forall msg. Boolean -> Property msg

The element should be automaticall focused after the page loads. For button, inpupt, keygen, select, and textarea.

#disabled Source

disabled :: forall msg. Boolean -> Property msg

Indicates whether the user can interact with a button, fieldset, input, keygen, optgroup, option select or textarea.

#minlength Source

minlength :: forall msg. Int -> Property msg

Defines the minimum number of characters allowed in an input or textarea

#maxlength Source

maxlength :: forall msg. Int -> Property msg

Defines the minimum number of characters allowed in an input or textarea

#multiple Source

multiple :: forall msg. Boolean -> Property msg

Indicates whether multiple values can be entered in an input of type email or file. Can also indicate that you can select many options.

#name Source

name :: forall msg. String -> Property msg

Name of the element. Used by a server to identify the fields in the form submit.

#novalidate Source

novalidate :: forall msg. Boolean -> Property msg

This indicates that a form should not be validated when submitted.

#pattern Source

pattern :: forall msg. String -> Property msg

Defines a regular expression which an input will be validated against.

#readonly Source

readonly :: forall msg. Boolean -> Property msg

Indicates whether an input or textarea can be edited.

#required Source

required :: forall msg. Boolean -> Property msg

Indicates wheter this element is required to be filled out. For inpupt, select and textarea.

#size Source

size :: forall msg. Int -> Property msg

For input specifies the width of an input in characters. For select the number of visible options in dropdown list

#for Source

for :: forall msg. String -> Property msg

The element ID described by this label.

#form Source

form :: forall msg. String -> Property msg

The element ID of the form for this button, fieldset, inpupt, keygen, label, meter, object, output, progress, select or textarea

#max Source

max :: forall msg. String -> Property msg

Maximum value for value allowed. For input of type number or date, the max value must be a number or date. For input, meter and progress

#min Source

min :: forall msg. String -> Property msg

Minimum value for value allowed. For input of type number or date, the min value must be a number or date. For input, meter and progress

#step Source

step :: forall msg. String -> Property msg

Step size for an input. Use step "any" to allow any floating point number.

#cols Source

cols :: forall msg. Int -> Property msg

Number of columns in a textarea

#rows Source

rows :: forall msg. Int -> Property msg

Number of rows in a textarea

#wrap Source

wrap :: forall msg. String -> Property msg

Indicates whether the text should be wrapped in a textarea. Possible values are 'soft' and 'hard'

#href Source

href :: forall msg. String -> Property msg

The URL of a linked resource, such as a, area, base, or link

#target Source

target :: forall msg. String -> Property msg

Specify where the result of clicking an a, area, base or form would appear. blank (new window or tab), self (same frame, default), partent (parent frame), top (full body of the window). Also takes the name of any frame you created. As if.

#downloadAs Source

downloadAs :: forall msg. String -> Property msg

Indicates that clicking an a and area will download the resource, and that the downloaded resource will have the given filename.

#download Source

download :: forall msg. Boolean -> Property msg

Indicates that clicking an a or area will download the resource

#colspan Source

colspan :: forall msg. Int -> Property msg

Defines the number of columns a cell should span.

#rowspan Source

rowspan :: forall msg. Int -> Property msg

Defines the number of rows a cell should span.