Button Examples
This example page requires updates per issue 189. Please provide any additional feedback in this issue.
The following examples of the button design pattern demonstrate both command and toggle buttons.
Examples
Type | Element | Button | Accessibility Feature |
---|---|---|---|
Push button |
div
|
Print Page
|
|
Toggle button |
span
|
Mute |
|
Push button |
a
|
Show alert |
|
Keyboard Support
Key | Function |
---|---|
Space or enter | Activate or toggle button |
ARIA Roles, Properties and States
Role | Attribute | Element | Usage |
---|---|---|---|
button |
div , span , a
|
|
|
tabindex="0"
|
div , span , a
|
|
|
aria-pressed="false" |
span |
|
|
aria-pressed="true" |
span |
|
Javascript and CSS Source Code
- CSS: button.css
- Javascript: button.js