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").

attribute : Str, Str -> Attribute

accept

accept_charset

accesskey

action

align

allow

alt

autocapitalize

autocomplete

background

bgcolor

border

buffered

capture

challenge

charset

cite

class

code

codebase

color

cols

colspan

content

contenteditable

contextmenu

coords

crossorigin

csp

datetime

decoding

dir

dirname

download

draggable

enctype

enterkeyhint

for

form

formaction

formenctype

formmethod

formtarget

headers

height

hidden

high

href

hreflang

http_equiv

icon

id

importance

inputmode

integrity

intrinsicsize

itemprop

itemtype

keytype

kind

label

lang

language

list

loading

low

manifest

max

maxlength

media

method

min

minlength

name

oncontextmenu

optimum

pattern

ping

placeholder

poster

preload

property

radiogroup

referrerpolicy

rel

role

rows

rowspan

sandbox

scope

scoped

shape

size

sizes

slot

span

spellcheck

src

srcdoc

srclang

srcset

start

step

summary

tabindex

target

title

translate

type

usemap

value

width

wrap