Some of these are also globally available, including: busy, disabled, grabbed, hidden, invalid.
Supported for all elements.
Supported on button.
Use pressed when describing a toggle button--a button that can be "toggled" between
an on state and an off state (or an on state, an indeterminate state, and an off state).
Please check out these examples as well.
button
[ pressed <| Just True ]
[ text "This button should be styled for site viewers such that it's clear it's pressed!" ]Supported for textbox only.
Indicate whether the textbox is for multi-line inputs or single-line inputs.
Careful of default keyboard behavior when coupling this property with text inputs, which by default submit their form group on enter.
Available on comboBox or textbox.
Use when there's a suggestion for completing the field that shows up
in the line that the user is completing.
Be sure to indicate that the auto-completed text is selected.
Available on comboBox or textbox.
Use when there's a suggestion for completing the field that shows up as a list
of options from which the user can pick.
Be sure to indicate that the auto-completed text is selected.
Available on comboBox or textbox.
Use when there's a suggestion for completing the field when there's both
inline autocomplete and list autocomplete occurring at once.
Be sure to indicate that the auto-completed text is selected.
Available on checkbox, option, radio, switch
Check boxes can be checked (Just True), unchecked (Just False), or indeterminate (Nothing).
Other elements won't support tri-state checkedness.
See the checked spec.
Supported by gridCell, option, row, tab.
Indicate whether an element (in a single- or multi-selectable widget) is or is not selected.
Sets the indeterminate value to be true.
Supported for all elements.
For invalid grammar or spelling, please see invalidGrammar and invalidSpelling respectively.
Supported for all elements.
Supported for all elements.
Available on button, comboBox, document, link, section, sectionHead, and window.
Trickily, this attribute can be applied to either an element that is itself
expanded/collapsed, OR to an elment it controls that is either expanded/collapsed.
In the latter case, throw on a controls attribute as well to clarify the relationship.
Supported on checkBox, comboBox, grid, gridCell, listBox,
radioGroup, slider, spinButton, and textBox.
Indicates read-only status of a widget, although normal navigation rules and
copying behavior should apply. (Read: readOnly elements are navigable but
unchangeable, and disabled elements are neither navigable nor unchangebale).
Supported for all elements. Elements are not disabled (are enabled) by default.
Indicate that a modal is showing and the rest of the page contents are not interactable.
import Accessibility exposing (div, h2, p, text)
import Accessibility.Aria exposing (labelledBy)
import Accessibility.Role exposing (dialog)
import Accessibility.Widget exposing (modal)
import Html.Attributes exposing (id)
modal : Html msg
modal =
div [ dialog, modal, labelledBy "header-id" ]
[ h2 [ id "header-id" ] [ text "Modal Header" ]
, p [] [ text "Wow, such modal contents!" ]
]Pop-ups are supported for all elements (but not meant for use on tooltips).
The pop-up itself needs to have a containing element with one of these roles:
menu, listbox, tree, grid, or dialog, and the pop-up value must match.
That is, use hasMenuPopUp if the pop-up container has a role of menu.
See the spec.
Indicate that interaction with this element can trigger a menu pop-up.
Be careful while managing focus and triggering.
Indicate that interaction with this element can trigger a listBox pop-up.
Be careful while managing focus and triggering.
Indicate that interaction with this element can trigger a tree pop-up.
Be careful while managing focus and triggering.
Indicate that interaction with this element can trigger a grid pop-up.
Be careful while managing focus and triggering.
Indicate that interaction with this element can trigger a dialog pop-up.
Be careful while managing focus and triggering.
Supported on roles with some sense of inherent orientation:
progressBar, scrollbar, select, separator, slider, tabList, toolBar
Careful: default behavior is inconsistent across those roles.
Supported on roles with some sense of inherent orientation:
progressBar, scrollbar, select, separator, slider, tabList, toolBar
Careful: default behavior is inconsistent across those roles.
Supported by progressBar, scrollbar, separator, slider, and spinButton.
Set the min allowed value for a range widget.
Supported by progressBar, scrollbar, separator, slider, and spinButton.
Set the max allowed value for a range widget.
Supported by progressBar, scrollbar, separator, slider, and spinButton.
Set the current value for a range widget. Don't use this property for indeterminate states.
Supported by progressBar, scrollbar, separator, slider, and spinButton.
This property takes precedence over valueNow, and should show a human-readable
version of the current value. However, valueNow should always be used.
Supported by columnHeader and rowHeader, but only where those roles are
used on table or grid headers.
This should only be applied to one header at a time.
Table is sorted by this column's values in ascending order.
Supported by columnHeader and rowHeader, but only where those roles are
used on table or grid headers.
Only one column in a table should be sorting the values in table.
Table is sorted by this column's values in descending order.
Supported by columnHeader and rowHeader, but only where those roles are
used on table or grid headers.
Only one column in a table should be sorting the values in table.
Table is sorted by this column's values, but the algorithm for that sorting is custom (not ascending or descending).
Supported by columnHeader and rowHeader, but only where those roles are
used on table or grid headers.
Table is not sorted by this column's values.
Supported on grid, listBox, tabList, tree. (However, what would it mean
for a tabList, say, to have multiple selectable descendants?)
When true, users are not restricted to selecting only one selectable descendant at a time.
Supported for grid, heading, listItem, row, and tabList.
This attribute is about hierarchy--how many "levels" deep is an element? Please refer to the documentation to get a better sense of when to use.
h7 attributes =
div (heading :: level 7 :: attributes)
Supported by
comboBox,gridCell,listBox,radioGroup,spinButton,textBox,treeIndicate whether user input is or is not required on a field for valid form submission.