Icon button
The kit's icon-only button, button[nol-icon-button], applied to a native button, which keeps its own type, disabled and events. It shows a glyph and is named by its label; content projected into it follows the glyph, such as a ViewBadgeComponent. Marked aria-disabled, it stays focusable and looks disabled, without a hover fill, as a disabled one does.
Examples
Loading…
States
Loading…
API
Selector button[nol-icon-button]
Import from @noldova/ui.components.angular
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
icon | string | Required | The Material Symbols name of the glyph, such as |
label | string | Required | The button's accessible name, naming its action. |
pressed | boolean | undefined | Whether a toggle button is pressed, or undefined when the button is no toggle, which is the default. |
filled | boolean | false | Whether the button is a filled circle, for the main action of a field such as a composer's Send: the theme's button color, kept under the pointer, its glyph in the button text color, the |
overlay | boolean | false | Whether the button is a round overlay, for an action over an image such as an attachment's Remove: a circle the icon button's size across in the theme's |
backdrop | boolean | false | Whether an overlay icon button sits on the overlay backdrop itself, such as an image viewer's Close, where the |
buttonHeight | boolean | false | Whether the icon button takes the button's height, 1.625rem, in place of its own, for a row it shares with buttons, such as an image viewer's zoom out, percentage and zoom in, so they share one height and center line. Its glyph keeps the icon size. Ignored while |
danger | boolean | false | Whether the button's action destroys something, such as Delete or Remove: its glyph takes the theme's |
tabAction | boolean | false | Whether the button has a tab action's size, for an action at the end of a row that should sit and highlight as a tab's close button does, such as an Explorer row's actions: its hit region is the tab action's slot, |
busy | boolean | false | Whether the button's work is under way: the kit's spinner, in the glyph's color, stands centered in place of the glyph, so the button keeps its size exactly; under forced colors the spinner keeps its own look, a |
busyPressable | boolean | false | Whether a busy button still takes clicks, middle clicks, Enter and Space, as when a press while the work runs is the app's to answer, such as a shell block's Run while its commands run; it keeps the busy look and |
Accessibility
| Key | Action |
|---|---|
| Tab | Moves the focus to the icon button, or past it; a disabled one is skipped, and a busy one keeps its place. |
| Enter | Presses the icon button; a busy one ignores it, unless it is also busyPressable. |
| Space | Presses the icon button; a busy one ignores it, unless it is also busyPressable. |
The kit styles the native button, so it keeps the button role, with its own type, disabled state and events.
Its label is its accessible name, set as aria-label, since the glyph alone names nothing; the glyph is hidden from assistive technology with aria-hidden.
Given pressed, it is a toggle button and reports aria-pressed, true or false; without it, it has no pressed state.
A busy icon button is marked aria-busy while its spinner shows.
A button that stays focusable while unavailable takes aria-disabled and looks disabled.
Specification
Loading…