-
Notifications
You must be signed in to change notification settings - Fork 161
Icon Button Specification
Silvia Ivanova edited this page Oct 31, 2023
·
3 revisions
The igxIconButton
is a directive that wraps a native <button>
element and provides a way to use an icon as a fully functional button.
<button igxIconButton='outlined'>
<igx-icon>home</igx-icon>
</button>
- The icon button should support different types - flat, outlined, and contained.
- The icon button should support disabled state.
- The icon button should support sizing through a CSS variable.
- The icon button should be accessible with both keyboard and mouse devices.
- As a developer, I expect to be able to initialize an icon button using the
igxIconButton
directive. - As a developer, I expect to be able to set a different type to control the visual style of the element.
- As a developer, I expect to be able to set a disabled state to the icon button.
- As a developer, I expect to be able to customize the size and appearance of the icon button.
- As an end-user, I expect to be able to click an icon button that performs an action.
- As an end-user, I expect to be able to click an icon button that navigates to a URL.
- As an end-user, I expect to have distinct visual indications reflecting the different states of the component (disabled, focused, etc.).
- As an end-user, I expect to be able to interact with the element with a keyboard and with a pointer device.
The icon button comes in 3 different types - flat, outlined, contained (default), and with 3 different sizes - small, medium (default), and large. It should be fully styled in accordance with the currently selected theme.
-
igxIconButton
- Set the type of igxIconButton to be used. The default is set to contained.
- Should set the icon button size (small, medium, large) correctly.
- Should apply correct CSS classes to the element for all icon button types (flat, outlined, contained).
- Should apply correct CSS classes and attributes to the element when the icon button is disabled.
Guidance for usage of the igxIconButton
directive with elements different than buttons:
- role="button" https://www.w3.org/TR/wai-aria-1.1/#button
When the icon button is disabled:
- aria-disabled="true" https://www.w3.org/TR/wai-aria-1.1/#aria-disabled