Typed HTML
A typed layer over raw HTML elements.
The html module provides a typed layer over the raw html.elem function
that allows you to conveniently create HTML elements. HTML attributes are
exposed as function parameters that accept Typst types and automatically
take care of converting those into the appropriate HTML.
Some parameters are common to all typed HTML functions. These are listed at the bottom in the Global Attributes section instead of explicitly on each element for readability.
Example
#html.video(
  controls: true,
  width: 1280,
  height: 720,
  src: "sunrise.mp4",
)[
  Your browser does not support the video tag.
]
Function
a
aHyperlink.
download
downloadWhether to download the resource instead of navigating to it, and its filename if so.
href
hrefAddress of the hyperlink.
hreflang
hreflangLanguage of the linked resource.
Referrer policy for fetches initiated by the element.
Available string values
no-referrerno-referrer-when-downgradesame-originoriginstrict-originorigin-when-cross-originstrict-origin-when-cross-originunsafe-url
Relationship between the location in the document containing the hyperlink and the destination resource.
Available string values
alternatecanonicalauthorbookmarkdns-prefetchexpectexternalhelpiconmanifestmodulepreloadlicensenextnofollownoopenernoreferreropenerpingbackpreconnectprefetchpreloadprevprivacy-policysearchstylesheettagterms-of-service
type
typeHint for the type of the referenced resource.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
abbr
abbrAbbreviation.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
address
addressContact information for a page or article element.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
area
areaHyperlink or dead area on an image map.
alt
altReplacement text for use when images are not available.
coords
coordsCoordinates for the shape to be created in an image map. Expects an array of floating point numbers.
download
downloadWhether to download the resource instead of navigating to it, and its filename if so.
href
hrefAddress of the hyperlink.
Referrer policy for fetches initiated by the element.
Available string values
no-referrerno-referrer-when-downgradesame-originoriginstrict-originorigin-when-cross-originstrict-origin-when-cross-originunsafe-url
Relationship between the location in the document containing the hyperlink and the destination resource.
Available string values
alternatecanonicalauthorbookmarkdns-prefetchexpectexternalhelpiconmanifestmodulepreloadlicensenextnofollownoopenernoreferreropenerpingbackpreconnectprefetchpreloadprevprivacy-policysearchstylesheettagterms-of-service
shape
shapeThe kind of shape to be created in an image map.
Available string values
circledefaultpolyrect
article
articleSelf-contained syndicatable or reusable composition.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
aside
asideSidebar for tangentially related content.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
audio
audioAudio player.
autoplay
autoplayHint that the media resource can be started automatically when the page is loaded.
controls
controlsShow user agent controls.
crossorigin
crossoriginHow the element handles crossorigin requests.
Available string values
anonymoususe-credentials
loop
loopWhether to loop the media resource.
muted
mutedWhether to mute the media resource by default.
Hints how much buffering the media resource will likely need.
Available string values
metadata
src
srcAddress of the resource.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
b
bKeywords.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
base
baseBase URL and default target navigable for hyperlinks and forms.
bdi
bdiText directionality isolation.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
bdo
bdoText directionality formatting.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
blockquote
blockquoteA section quoted from another source.
body
bodyDocument body.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
button
buttonButton control.
command
commandIndicates to the targeted element which action to take.
Available string values
toggle-popovershow-popoverhide-popovercloserequest-closeshow-modal
commandfor
commandforTargets another element to be invoked.
disabled
disabledWhether the form control is disabled.
form
formAssociates the element with a form element.
formaction
formactionURL to use for form submission.
formenctype
formenctypeEntry list encoding type to use for form submission.
Available string values
application/x-www-form-urlencodedmultipart/form-datatext/plain
formnovalidate
formnovalidateBypass form control validation for form submission.
name
nameName of the element to use for form submission and in the form.elements API.
popovertarget
popovertargetTargets a popover element to toggle, show, or hide.
popovertargetaction
popovertargetactionIndicates whether a targeted popover element is to be toggled, shown, or hidden.
Available string values
toggleshowhide
value
valueValue to be used for form submission.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
canvas
canvasScriptable bitmap canvas.
caption
captionTable caption.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
cite
citeTitle of a work.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
code
codeComputer code.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
colgroup
colgroupGroup of columns in a table.
data
dataMachine-readable equivalent.
datalist
datalistContainer for options for combo box control.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
dd
ddContent for corresponding dt element(s).
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
del
delA removal from the document.
details
detailsDisclosure control for hiding details.
dfn
dfnDefining instance.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
dialog
dialogDialog box or window.
div
divGeneric flow container, or container for name-value groups in dl elements.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
dl
dlAssociation list consisting of zero or more name-value groups.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
dt
dtLegend for corresponding dd element(s).
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
em
emStress emphasis.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
embed
embedPlugin.
fieldset
fieldsetGroup of form controls.
disabled
disabledWhether the descendant form controls, except any inside legend, are disabled.
form
formAssociates the element with a form element.
name
nameName of the element to use for form submission and in the form.elements API.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
figcaption
figcaptionCaption for figure.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
figure
figureFigure with optional caption.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
footer
footerFooter for a page or section.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
form
formUser-submittable form.
action
actionURL to use for form submission.
autocomplete
autocompleteDefault setting for autofill feature for controls in the form.
enctype
enctypeEntry list encoding type to use for form submission.
Available string values
application/x-www-form-urlencodedmultipart/form-datatext/plain
name
nameName of form to use in the document.forms API.
novalidate
novalidateBypass form control validation for form submission.
Relationship between the document containing the form and its action destination
Available string values
alternatecanonicalauthorbookmarkdns-prefetchexpectexternalhelpiconmanifestmodulepreloadlicensenextnofollownoopenernoreferreropenerpingbackpreconnectprefetchpreloadprevprivacy-policysearchstylesheettagterms-of-service
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
h1
h1Heading.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
h2
h2Heading.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
h3
h3Heading.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
h4
h4Heading.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
h5
h5Heading.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
h6
h6Heading.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
head
headContainer for document metadata.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
header
headerIntroductory or navigational aids for a page or section.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
hgroup
hgroupHeading container.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
html
htmlRoot element.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
i
iAlternate voice.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
iframe
iframeChild navigable.
allow
allowPermissions policy to be applied to the iframe's contents.
allowfullscreen
allowfullscreenWhether to allow the iframe's contents to use requestFullscreen().
height
heightVertical dimension.
Referrer policy for fetches initiated by the element.
Available string values
no-referrerno-referrer-when-downgradesame-originoriginstrict-originorigin-when-cross-originstrict-origin-when-cross-originunsafe-url
Security rules for nested content.
Available string values
allow-downloadsallow-formsallow-modalsallow-orientation-lockallow-pointer-lockallow-popupsallow-popups-to-escape-sandboxallow-presentationallow-same-originallow-scriptsallow-top-navigationallow-top-navigation-by-user-activationallow-top-navigation-to-custom-protocols
src
srcAddress of the resource.
srcdoc
srcdocA document to render in the iframe.
width
widthHorizontal dimension.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
img
imgImage.
alt
altReplacement text for use when images are not available.
crossorigin
crossoriginHow the element handles crossorigin requests.
Available string values
anonymoususe-credentials
Decoding hint to use when processing this image for presentation.
Available string values
syncasync
Sets the priority for fetches initiated by the element.
Available string values
highlow
height
heightVertical dimension.
ismap
ismapWhether the image is a server-side image map.
Referrer policy for fetches initiated by the element.
Available string values
no-referrerno-referrer-when-downgradesame-originoriginstrict-originorigin-when-cross-originstrict-origin-when-cross-originunsafe-url
sizes
sizesImage sizes for different page layouts. Expects an array of dictionaries with the keys condition (string) and size (length).
src
srcAddress of the resource.
srcset
srcsetImages to use in different situations, e.g., high-resolution displays, small monitors, etc. Expects an array of dictionaries with the keys src (string) and width (integer) or density (float).
usemap
usemapName of image map to use.
width
widthHorizontal dimension.
input
inputForm control.
alpha
alphaAllow the color's alpha component to be set.
alt
altReplacement text for use when images are not available.
Hint for form autofill feature.
Available string values
shippingbillingnamehonorific-prefixgiven-nameadditional-namefamily-namehonorific-suffixnicknameusernamenew-passwordcurrent-passwordone-time-codeorganization-titleorganizationstreet-addressaddress-line1address-line2address-line3address-level4address-level3address-level2address-level1countrycountry-namepostal-codecc-namecc-given-namecc-additional-namecc-family-namecc-numbercc-expcc-exp-monthcc-exp-yearcc-csccc-typetransaction-currencytransaction-amountlanguagebdaybday-daybday-monthbday-yearsexurlphotohomeworkmobilefaxpagerteltel-country-codetel-nationaltel-area-codetel-localtel-local-prefixtel-local-suffixtel-extensionemailimpp
checked
checkedWhether the control is checked.
dirname
dirnameName of form control to use for sending the element's directionality in form submission.
disabled
disabledWhether the form control is disabled.
form
formAssociates the element with a form element.
formaction
formactionURL to use for form submission.
formenctype
formenctypeEntry list encoding type to use for form submission.
Available string values
application/x-www-form-urlencodedmultipart/form-datatext/plain
formnovalidate
formnovalidateBypass form control validation for form submission.
height
heightVertical dimension.
list
listList of autocomplete options.
maxlength
maxlengthMaximum length of value.
minlength
minlengthMinimum length of value.
multiple
multipleWhether to allow multiple values.
name
nameName of the element to use for form submission and in the form.elements API.
pattern
patternPattern to be matched by the form control's value.
placeholder
placeholderUser-visible label to be placed within the form control.
popovertarget
popovertargetTargets a popover element to toggle, show, or hide.
popovertargetaction
popovertargetactionIndicates whether a targeted popover element is to be toggled, shown, or hidden.
Available string values
toggleshowhide
readonly
readonlyWhether to allow the value to be edited by the user.
required
requiredWhether the control is required for form submission.
size
sizeSize of the control.
src
srcAddress of the resource.
type
typeType of form control.
Available string values
hiddentextsearchtelurlemailpassworddatemonthweektimedatetime-localnumberrangecolorcheckboxradiofilesubmitimageresetbutton
width
widthHorizontal dimension.
ins
insAn addition to the document.
kbd
kbdUser input.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
label
labelCaption for a form control.
legend
legendCaption for fieldset.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
li
liList item.
link
linkLink metadata.
as
asPotential destination for a preload request (for rel="preload" and rel="modulepreload").
Available string values
audioaudioworkletdocumentembedfontframeiframeimagejsonmanifestobjectpaintworkletreportscriptserviceworkersharedworkerstyletrackvideowebidentityworkerxslt
color
colorColor to use when customizing a site's icon (for rel="mask-icon").
crossorigin
crossoriginHow the element handles crossorigin requests.
Available string values
anonymoususe-credentials
disabled
disabledWhether the link is disabled.
Sets the priority for fetches initiated by the element.
Available string values
highlow
href
hrefAddress of the hyperlink.
hreflang
hreflangLanguage of the linked resource.
imagesizes
imagesizesImage sizes for different page layouts (for rel="preload"). Expects an array of dictionaries with the keys condition (string) and size (length).
imagesrcset
imagesrcsetImages to use in different situations, e.g., high-resolution displays, small monitors, etc. (for rel="preload"). Expects an array of dictionaries with the keys src (string) and width (integer) or density (float).
integrity
integrityIntegrity metadata used in Subresource Integrity checks.
media
mediaApplicable media.
Referrer policy for fetches initiated by the element.
Available string values
no-referrerno-referrer-when-downgradesame-originoriginstrict-originorigin-when-cross-originstrict-origin-when-cross-originunsafe-url
Relationship between the document containing the hyperlink and the destination resource.
Available string values
alternatecanonicalauthorbookmarkdns-prefetchexpectexternalhelpiconmanifestmodulepreloadlicensenextnofollownoopenernoreferreropenerpingbackpreconnectprefetchpreloadprevprivacy-policysearchstylesheettagterms-of-service
sizes
sizesSizes of the icons (for rel="icon"). Expects an array of sizes. Each size is specified as an array of two integers (width and height).
type
typeHint for the type of the referenced resource.
main
mainContainer for the dominant contents of the document.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
map
mapImage map.
mark
markHighlight.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
menu
menuMenu of commands.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
meta
metaText metadata.
meter
meterGauge.
high
highLow limit of high range.
low
lowHigh limit of low range.
max
maxUpper bound of range.
min
minLower bound of range.
optimum
optimumOptimum value in gauge.
value
valueCurrent value of the element.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
nav
navSection with navigational links.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
noscript
noscriptFallback content for script.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
object
objectImage, child navigable, or plugin.
data
dataAddress of the resource.
form
formAssociates the element with a form element.
height
heightVertical dimension.
type
typeType of embedded resource.
width
widthHorizontal dimension.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
ol
olOrdered list.
optgroup
optgroupGroup of options in a list box.
option
optionOption in a list box or combo box control.
disabled
disabledWhether the form control is disabled.
label
labelUser-visible label.
selected
selectedWhether the option is selected by default.
value
valueValue to be used for form submission.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
output
outputCalculated output value.
form
formAssociates the element with a form element.
name
nameName of the element to use for form submission and in the form.elements API.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
p
pParagraph.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
picture
pictureImage.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
pre
preBlock of preformatted text.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
progress
progressProgress bar.
q
qQuotation.
rp
rpParenthesis for ruby annotation text.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
rt
rtRuby annotation text.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
ruby
rubyRuby annotation(s).
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
s
sInaccurate text.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
samp
sampComputer output.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
script
scriptEmbedded script.
async
asyncExecute script when available, without blocking while fetching.
crossorigin
crossoriginHow the element handles crossorigin requests.
Available string values
anonymoususe-credentials
defer
deferDefer script execution.
Sets the priority for fetches initiated by the element.
Available string values
highlow
integrity
integrityIntegrity metadata used in Subresource Integrity checks.
nomodule
nomodulePrevents execution in user agents that support module scripts.
Referrer policy for fetches initiated by the element.
Available string values
no-referrerno-referrer-when-downgradesame-originoriginstrict-originorigin-when-cross-originstrict-origin-when-cross-originunsafe-url
src
srcAddress of the resource.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
search
searchContainer for search controls.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
section
sectionGeneric document or application section.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
select
selectList box control.
Hint for form autofill feature.
Available string values
shippingbillingnamehonorific-prefixgiven-nameadditional-namefamily-namehonorific-suffixnicknameusernamenew-passwordcurrent-passwordone-time-codeorganization-titleorganizationstreet-addressaddress-line1address-line2address-line3address-level4address-level3address-level2address-level1countrycountry-namepostal-codecc-namecc-given-namecc-additional-namecc-family-namecc-numbercc-expcc-exp-monthcc-exp-yearcc-csccc-typetransaction-currencytransaction-amountlanguagebdaybday-daybday-monthbday-yearsexurlphotohomeworkmobilefaxpagerteltel-country-codetel-nationaltel-area-codetel-localtel-local-prefixtel-local-suffixtel-extensionemailimpp
disabled
disabledWhether the form control is disabled.
form
formAssociates the element with a form element.
multiple
multipleWhether to allow multiple values.
name
nameName of the element to use for form submission and in the form.elements API.
required
requiredWhether the control is required for form submission.
size
sizeSize of the control.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
slot
slotShadow tree slot.
small
smallSide comment.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
source
sourceImage source for img or media source for video or audio.
height
heightVertical dimension.
media
mediaApplicable media.
sizes
sizesImage sizes for different page layouts. Expects an array of dictionaries with the keys condition (string) and size (length).
src
srcAddress of the resource.
srcset
srcsetImages to use in different situations, e.g., high-resolution displays, small monitors, etc. Expects an array of dictionaries with the keys src (string) and width (integer) or density (float).
type
typeType of embedded resource.
width
widthHorizontal dimension.
span
spanGeneric phrasing container.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
strong
strongImportance.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
style
styleEmbedded styling information.
sub
subSubscript.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
summary
summaryCaption for details.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
sup
supSuperscript.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
table
tableTable.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
tbody
tbodyGroup of rows in a table.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
td
tdTable cell.
colspan
colspanNumber of columns that the cell is to span.
rowspan
rowspanNumber of rows that the cell is to span.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
template
templateTemplate.
html.template(,,,,,)->shadowrootclonable
shadowrootclonableSets clonable on a declarative shadow root.
shadowrootcustomelementregistry
shadowrootcustomelementregistryEnables declarative shadow roots to indicate they will use a custom element registry.
shadowrootdelegatesfocus
shadowrootdelegatesfocusSets delegates focus on a declarative shadow root.
shadowrootserializable
shadowrootserializableSets serializable on a declarative shadow root.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
textarea
textareaMultiline text controls.
Hint for form autofill feature.
Available string values
shippingbillingnamehonorific-prefixgiven-nameadditional-namefamily-namehonorific-suffixnicknameusernamenew-passwordcurrent-passwordone-time-codeorganization-titleorganizationstreet-addressaddress-line1address-line2address-line3address-level4address-level3address-level2address-level1countrycountry-namepostal-codecc-namecc-given-namecc-additional-namecc-family-namecc-numbercc-expcc-exp-monthcc-exp-yearcc-csccc-typetransaction-currencytransaction-amountlanguagebdaybday-daybday-monthbday-yearsexurlphotohomeworkmobilefaxpagerteltel-country-codetel-nationaltel-area-codetel-localtel-local-prefixtel-local-suffixtel-extensionemailimpp
cols
colsMaximum number of characters per line.
dirname
dirnameName of form control to use for sending the element's directionality in form submission.
disabled
disabledWhether the form control is disabled.
form
formAssociates the element with a form element.
maxlength
maxlengthMaximum length of value.
minlength
minlengthMinimum length of value.
name
nameName of the element to use for form submission and in the form.elements API.
placeholder
placeholderUser-visible label to be placed within the form control.
readonly
readonlyWhether to allow the value to be edited by the user.
required
requiredWhether the control is required for form submission.
rows
rowsNumber of lines to show.
wrap
wrapHow the value of the form control is to be wrapped for form submission.
Available string values
softhard
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
tfoot
tfootGroup of footer rows in a table.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
th
thTable header cell.
abbr
abbrAlternative label to use for the header cell when referencing the cell in other contexts.
colspan
colspanNumber of columns that the cell is to span.
rowspan
rowspanNumber of rows that the cell is to span.
scope
scopeSpecifies which cells the header cell applies to.
Available string values
rowcolrowgroupcolgroup
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
thead
theadGroup of heading rows in a table.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
time
timeMachine-readable equivalent of date- or time-related data.
title
titleDocument title.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
tr
trTable row.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
track
trackTimed text track.
u
uUnarticulated annotation.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
ul
ulList.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
var
varVariable.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
video
videoVideo player.
autoplay
autoplayHint that the media resource can be started automatically when the page is loaded.
controls
controlsShow user agent controls.
crossorigin
crossoriginHow the element handles crossorigin requests.
Available string values
anonymoususe-credentials
height
heightVertical dimension.
loop
loopWhether to loop the media resource.
muted
mutedWhether to mute the media resource by default.
playsinline
playsinlineEncourage the user agent to display video content within the element's playback area.
poster
posterPoster frame to show prior to video playback.
Hints how much buffering the media resource will likely need.
Available string values
metadata
src
srcAddress of the resource.
width
widthHorizontal dimension.
bodyPositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe contents of the HTML element.
Global Attributes
Keyboard shortcut to activate or focus element. Expects a single-codepoint string or an array thereof.
aria-activedescendant
aria-activedescendantIdentifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
aria-atomic
aria-atomicIndicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
Available string values
inlineWhen a user is providing input, text suggesting one way to complete the provided input may be dynamically inserted after the caret.
listWhen a user is providing input, an element containing a collection of values that could complete the provided input may be displayed.
bothWhen a user is providing input, an element containing a collection of values that could complete the provided input may be displayed. If displayed, one value in the collection is automatically selected, and the text needed to complete the automatically selected value appears after the caret in the input.
aria-busy
aria-busyIndicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.
Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. See related aria-pressed and aria-selected.
Available string values
mixedAn intermediate value between true and false.
aria-colcount
aria-colcountDefines the total number of columns in a table, grid, or treegrid. See related aria-colindex.
aria-colindex
aria-colindexDefines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. See related aria-colcount and aria-colspan.
aria-colspan
aria-colspanDefines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. See related aria-colindex and aria-rowspan.
Identifies the element (or elements) whose contents or presence are controlled by the current element. See related aria-owns.
Indicates the element that represents the current item within a container or set of related elements.
Available string values
pageRepresents the current page within a set of pages.
stepRepresents the current step within a process.
locationRepresents the current location within an environment or context.
dateRepresents the current date within a collection of dates.
timeRepresents the current time within a set of times.
Identifies the element (or elements) that describes the object. See related aria-labelledby.
aria-details
aria-detailsIdentifies the element that provides a detailed, extended description for the object. See related aria-describedby.
aria-disabled
aria-disabledIndicates that the element is perceivable but disabled, so it is not editable or otherwise operable. See related aria-hidden and aria-readonly.
aria-errormessage
aria-errormessageIdentifies the element that provides an error message for the object. See related aria-invalid and aria-describedby.
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
Available string values
menuIndicates the popup is a menu.
listboxIndicates the popup is a listbox.
treeIndicates the popup is a tree.
gridIndicates the popup is a grid.
dialogIndicates the popup is a dialog.
Indicates whether the element is exposed to an accessibility API. See related aria-disabled.
Indicates the entered value does not conform to the format expected by the application. See related aria-errormessage.
Available string values
grammarA grammatical error was detected.
spellingA spelling error was detected.
aria-keyshortcuts
aria-keyshortcutsIndicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
aria-label
aria-labelDefines a string value that labels the current element. See related aria-labelledby.
Identifies the element (or elements) that labels the current element. See related aria-describedby.
aria-level
aria-levelDefines the hierarchical level of an element within a structure.
aria-live
aria-liveIndicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
Available string values
assertiveIndicates that updates to the region have the highest priority and should be presented the user immediately.
offIndicates that updates to the region should not be presented to the user unless the used is currently focused on that region.
politeIndicates that updates to the region should be presented at the next graceful opportunity, such as at the end of speaking the current sentence or when the user pauses typing.
aria-modal
aria-modalIndicates whether an element is modal when displayed.
aria-multiline
aria-multilineIndicates whether a text box accepts multiple lines of input or only a single line.
aria-multiselectable
aria-multiselectableIndicates that the user may select more than one item from the current selectable descendants.
aria-orientation
aria-orientationIndicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
Available string values
horizontalThe element is oriented horizontally.
undefinedThe element's orientation is unknown/ambiguous.
verticalThe element is oriented vertically.
Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship. See related aria-controls.
aria-placeholder
aria-placeholderDefines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
aria-posinset
aria-posinsetDefines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-setsize.
Indicates the current "pressed" state of toggle buttons. See related aria-checked and aria-selected.
Available string values
mixedAn intermediate value between true and false.
aria-readonly
aria-readonlyIndicates that the element is not editable, but is otherwise operable. See related aria-disabled.
Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. See related aria-atomic.
Available string values
additionsElement nodes are added to the accessibility tree within the live region.
additions textEquivalent to the combination of values, "additions text".
allEquivalent to the combination of all values, "additions removals text".
removalsText content, a text alternative, or an element node within the live region is removed from the accessibility tree.
textText content or a text alternative is added to any descendant in the accessibility tree of the live region.
aria-required
aria-requiredIndicates that user input is required on the element before a form may be submitted.
aria-roledescription
aria-roledescriptionDefines a human-readable, author-localized description for the role of an element.
aria-rowcount
aria-rowcountDefines the total number of rows in a table, grid, or treegrid. See related aria-rowindex.
aria-rowindex
aria-rowindexDefines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. See related aria-rowcount and aria-rowspan.
aria-rowspan
aria-rowspanDefines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. See related aria-rowindex and aria-colspan.
Indicates the current "selected" state of various widgets. See related aria-checked and aria-pressed.
aria-setsize
aria-setsizeDefines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-posinset.
Indicates if items in a table or grid are sorted in ascending or descending order.
Available string values
ascendingItems are sorted in ascending order by this column.
descendingItems are sorted in descending order by this column.
otherA sort algorithm other than ascending or descending has been applied.
aria-valuemax
aria-valuemaxDefines the maximum allowed value for a range widget.
aria-valuemin
aria-valueminDefines the minimum allowed value for a range widget.
aria-valuenow
aria-valuenowDefines the current value for a range widget. See related aria-valuetext.
aria-valuetext
aria-valuetextDefines the human readable text alternative of aria-valuenow for a range widget.
Recommended autocapitalization behavior (for supported input methods).
Available string values
sentenceswordscharacters
autocorrect
autocorrectRecommended autocorrection behavior (for supported input methods).
autofocus
autofocusAutomatically focus the element when the page is loaded.
draggable
draggableWhether the element is draggable.
enterkeyhint
enterkeyhintHint for selecting an enter key action.
Available string values
enterdonegonextprevioussearchsend
id
idThe element's ID.
inert
inertWhether the element is inert.
Hint for selecting an input modality.
Available string values
texttelemailurlnumericdecimalsearch
is
isCreates a customized built-in element.
itemid
itemidGlobal identifier for a microdata item.
itemscope
itemscopeIntroduces a microdata item.
nonce
nonceCryptographic nonce used in Content Security Policy checks.
An ARIA role.
Available string values
alertA type of live region with important, and usually time-sensitive, information. See related alertdialog and status.
alertdialogA type of dialog that contains an alert message, where initial focus goes to an element within the dialog. See related alert and dialog.
applicationA structure containing one or more focusable elements requiring user input, such as keyboard or gesture events, that do not follow a standard interaction pattern supported by a widget role.
articleA section of a page that consists of a composition that forms an independent part of a document, page, or site.
bannerA region that contains mostly site-oriented content, rather than page-specific content.
buttonAn input that allows for user-triggered actions when clicked or pressed. See related link.
cellA cell in a tabular container. See related gridcell.
checkboxA checkable input that has three possible values: true, false, or mixed.
columnheaderA cell containing header information for a column.
comboboxA composite widget containing a single-line textbox and another element, such as a listbox or grid, that can dynamically pop up to help the user set the value of the textbox.
commandA form of widget that performs an action but does not receive input data.
complementaryA supporting section of the document, designed to be complementary to the main content at a similar level in the DOM hierarchy, but remains meaningful when separated from the main content.
compositeA widget that may contain navigable descendants or owned children.
contentinfoA large perceivable region that contains information about the parent document.
definitionA definition of a term or concept. See related term.
dialogA dialog is a descendant window of the primary window of a web application. For HTML pages, the primary application window is the entire web document, i.e., the body element.
directoryA list of references to members of a group, such as a static table of contents.
documentAn element containing content that assistive technology users may want to browse in a reading mode.
feedA scrollable list of articles where scrolling may cause articles to be added to or removed from either end of the list.
figureA perceivable section of content that typically contains a graphical document, images, code snippets, or example text. The parts of a figure MAY be user-navigable.
formA landmark region that contains a collection of items and objects that, as a whole, combine to create a form. See related search.
gridA composite widget containing a collection of one or more rows with one or more cells where some or all cells in the grid are focusable by using methods of two-dimensional navigation, such as directional arrow keys.
gridcellA cell in a grid or treegrid.
groupA set of user interface objects which are not intended to be included in a page summary or table of contents by assistive technologies.
headingA heading for a section of the page.
imgA container for a collection of elements that form an image.
inputA generic type of widget that allows user input.
landmarkA perceivable section containing content that is relevant to a specific, author-specified purpose and sufficiently important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page. Such a page summary could be generated dynamically by a user agent or assistive technology.
linkAn interactive reference to an internal or external resource that, when activated, causes the user agent to navigate to that resource. See related button.
listA section containing listitem elements. See related listbox.
listboxA widget that allows the user to select one or more items from a list of choices. See related combobox and list.
listitemA single item in a list or directory.
logA type of live region where new information is added in meaningful order and old information may disappear. See related marquee.
mainThe main content of a document.
marqueeA type of live region where non-essential information changes frequently. See related log.
mathContent that represents a mathematical expression.
menuA type of widget that offers a list of choices to the user.
menubarA presentation of menu that usually remains visible and is usually presented horizontally.
menuitemAn option in a set of choices contained by a menu or menubar.
menuitemcheckboxA menuitem with a checkable state whose possible values are true, false, or mixed.
menuitemradioA checkable menuitem in a set of elements with the same role, only one of which can be checked at a time.
navigationA collection of navigational elements (usually links) for navigating the document or related documents.
noteA section whose content is parenthetic or ancillary to the main content of the resource.
optionA selectable item in a select list.
presentationAn element whose implicit native role semantics will not be mapped to the accessibility API. See synonym none.
progressbarAn element that displays the progress status for tasks that take a long time.
radioA checkable input in a group of elements with the same role, only one of which can be checked at a time.
radiogroupA group of radio buttons.
rangeAn input representing a range of values that can be set by the user.
regionA perceivable section containing content that is relevant to a specific, author-specified purpose and sufficiently important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page. Such a page summary could be generated dynamically by a user agent or assistive technology.
roletypeThe base role from which all other roles in this taxonomy inherit.
rowA row of cells in a tabular container.
rowgroupA structure containing one or more row elements in a tabular container.
rowheaderA cell containing header information for a row in a grid.
scrollbarA graphical object that controls the scrolling of content within a viewing area, regardless of whether the content is fully displayed within the viewing area.
searchA landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility. See related form and searchbox.
searchboxA type of textbox intended for specifying search criteria. See related textbox and search.
sectionA renderable structural containment unit in a document or application.
sectionheadA structure that labels or summarizes the topic of its related section.
selectA form widget that allows the user to make selections from a set of choices.
separatorA divider that separates and distinguishes sections of content or groups of menuitems.
sliderA user input where the user selects a value from within a given range.
spinbuttonA form of range that expects the user to select from among discrete choices.
statusA type of live region whose content is advisory information for the user but is not important enough to justify an alert, often but not necessarily presented as a status bar.
structureA document structural element.
switchA type of checkbox that represents on/off values, as opposed to checked/unchecked values. See related checkbox.
tabA grouping label providing a mechanism for selecting the tab content that is to be rendered to the user.
tableA section containing data arranged in rows and columns. See related grid.
tablistA list of tab elements, which are references to tabpanel elements.
tabpanelA container for the resources associated with a tab, where each tab is contained in a tablist.
termA word or phrase with a corresponding definition. See related definition.
textboxA type of input that allows free-form text as its value.
timerA type of live region containing a numerical counter which indicates an amount of elapsed time from a start point, or the time remaining until an end point.
toolbarA collection of commonly used function buttons or controls represented in compact visual form.
tooltipA contextual popup that displays a description for an element.
treeA type of list that may contain sub-level nested groups that can be collapsed and expanded.
treegridA grid whose rows can be expanded and collapsed in the same manner as for a tree.
treeitemAn option item of a tree. This is an element within a tree that may be expanded or collapsed if it contains a sub-level group of tree item elements.
widgetAn interactive component of a graphical user interface (GUI).
windowA browser or application window.
slot
slotThe element's desired slot.
spellcheck
spellcheckWhether the element is to have its spelling and grammar checked.
style
stylePresentational and formatting instructions.
tabindex
tabindexWhether the element is focusable and sequentially focusable, and the relative order of the element for the purposes of sequential focus navigation.
title
titleAdvisory information for the element.
translate
translateWhether the element is to be translated when the page is localized.
writingsuggestions
writingsuggestionsWhether the element can offer writing suggestions or not.