Attribute
Attribute
classes : List Str -> Attribute
class_list : List
(
Str,
Bool
)
-> Attribute
style : List
(
Str,
Str
)
-> Attribute
data : Str, Str -> Attribute
aria : Str, Str -> Attribute
allowfullscreen
alpha
async
autofocus
autoplay
controls
default
defer
formnovalidate
inert
ismap
itemscope
loop
multiple
muted
nomodule
novalidate
open
playsinline
readonly
required
reversed
selected
shadowrootclonable
shadowrootdelegatesfocus
shadowrootserializable
checked : Bool -> Attribute
checked is a boolean/binary attribute. Given Bool.true it'll be present on the element,
otherwise it'll be absent. It's impossible to set it to a certain value like other attributes
(e.g. checked="true" or checked="1").
This platform uses percy-dom to render HTML and percy-dom treats checked in a non-standard
way. Usually checked is used to determine if the element is checked by default on first
render, but it will not be affected if a user checks/unchecks the element later. There's a
different way to access the current state of the element, but it's not this attribute. However,
percy-dom goes against the grain and does use this attribute to set the current state of the
element. This makes for an ergonomic API:
input([ type("checkbox"), checked(is_checked) ] [ { name: "onclick", handler: ...
If the onclick event toggles the value of is_checked, the element will be re-rendered and its
state will change to reflect its current "checkedness".
Read more: https://chinedufn.github.io/percy/html-macro/boolean-attributes/index.html https://chinedufn.github.io/percy/html-macro/special-attributes/index.html
disabled : Bool -> Attribute
disabled is a boolean/binary attribute. Given Bool.true it'll be present on the element,
otherwise it'll be absent. It's impossible to set it to a certain value like other attributes
(e.g. disabled="true" or disabled="1").