A form of range that expects the user to select from among discrete choices.
A spinbutton typically allows the user to select from the given range through the use of an up and down button on the keyboard. Visibly, the current value is incremented or decremented until a maximum or minimum value is reached. Authors SHOULD ensure this functionality is accomplished programmatically through the use of up and down arrows on the keyboard.
Although a spinbutton is similar in appearance to many presentations of select, it is advisable to use spinbutton when working with known ranges (especially in the case of large ranges) as opposed to distinct options. For example, a spinbutton representing a range from 1 to 1,000,000 would provide much better performance than a select widget representing the same values.
Authors MAY create a spinbutton with children or owned elements, but MUST limit those elements to a textbox and/or two buttons.
To be keyboard accessible, authors SHOULD manage focus of descendants for all instances of this role, as described in Managing Focus. When a spinbutton receives focus, authors SHOULD ensure focus is placed on the textbox element if one is present, and on the spinbutton itself otherwise. Authors SHOULD NOT include contained button elements in the primary navigation ring, e.g., the Tab ring in HTML, because they are superfluous for people using keyboard devices.
Authors MUST set the aria-valuenow attribute. Authors SHOULD set the aria-valuemin attribute when there is a minimum value, and the aria-valuemax attribute when there is a maximum value. If missing or not a number, the implicit values of these attributes are as follows:
- The implicit value of aria-valuemin is that there is no minimum value.
- The implicit value of aria-valuemax is that there is no maximum value.
- The implicit value of aria-valuenow is 0.
Required States and Properties
Supported States and Properties
Inherited States and Properties
- aria-busy (state)
- aria-current (state)
- aria-disabled (state)
- aria-grabbed (state)
- aria-hidden (state)
- aria-invalid (state)
Accessible Name Required
Implicit Value for Rrole
- Default for aria-valuemin is that there is no minimum value.
- Default for aria-valuemax is that there is no maximum value.
- Default for aria-valuenow is 0.
No HTML element equivalent.