.. _dijit/form/Button: dijit.form.Button ================= :Authors: Becky Gibson, Doug Hays, Bill Keese, Nikolai Onken, Marcus Reimann :Project owner: Bill Keese :Available: since V0.9 .. contents:: :depth: 2 ============ Introduction ============ The dijit.form.Button widget is a representation of a normal
Declarative example ------------------- As usual you can create the button widget declaratively using the dojoType attribute .. cv-compound:: .. cv:: javascript .. cv:: html
Show only the icon ------------------ Buttons can have icons and labels, and sometimes they just display an icon, but even in that case you should specify a label for a11y reasons. Use the showLabel parameter to supress it from appearing under normal circumstances: .. cv-compound:: .. cv:: javascript .. cv:: html Change the icon --------------- You can change an icon of a Button using its iconClass attribute. Following example toggles the icon if the button: .. cv-compound:: .. cv:: javascript .. cv:: html ============= Accessibility ============= Keyboard -------- ========================================== ================================================= Action Key ========================================== ================================================= Navigate to a button tab - all buttons are in the tab order Activate the button enter or space key ========================================== ================================================= Known Issues ------------ High Contrast Mode ~~~~~~~~~~~~~~~~~~ All buttons should include a label parameter with text for the button even if the showLabel parameter is set to false. The label parameter is used to identify the button in high contrast mode when the icon for the button will no longer be displayed and is also used to identify the button to a screen reader. Screen Reader ~~~~~~~~~~~~~ In order to identify the button description to the screen reader, all buttons should include a label parameter even if the showLabel parameter is set to false.