API reference for Angular Material button
import {MatButtonModule} from '@angular/material/button';
Directives
MatButton
Material design button.
Selector: button[mat-button] button[mat-raised-button] button[mat-icon-button] button[mat-fab] button[mat-mini-fab] button[mat-stroked-button] button[mat-flat-button]
Exported as: matButtonProperties
Name | Description |
---|---|
@Input()
|
Theme color palette for the component. |
@Input()
|
Whether ripples are disabled. |
@Input()
|
Whether the component is disabled. |
|
Default color to fall back to if no value is set. |
|
Whether the button is icon button. |
|
Whether the button is round. |
|
Reference to the MatRipple instance of the button. |
Methods
focus | |
---|---|
Focuses the button. |
|
Parameters | |
origin FocusOrigin = 'program'
|
|
options? FocusOptions
|
|
MatAnchor
extends
MatButton
Material design anchor button.
Selector: a[mat-button] a[mat-raised-button] a[mat-icon-button] a[mat-fab] a[mat-mini-fab] a[mat-stroked-button] a[mat-flat-button]
Exported as: matButton, matAnchorProperties
Name | Description |
---|---|
@Input()
|
Theme color palette for the component. |
@Input()
|
Whether ripples are disabled. |
@Input()
|
Whether the component is disabled. |
|
Default color to fall back to if no value is set. |
|
Whether the button is icon button. |
|
Whether the button is round. |
|
Reference to the MatRipple instance of the button. |
Methods
focus | |
---|---|
Focuses the button. |
|
Parameters | |
origin FocusOrigin = 'program'
|
|
options? FocusOptions
|
|
API reference for Angular Material button-testing
import {MatButtonHarness} from '@angular/material/button/testing';
Classes
MatButtonHarness
extends
ComponentHarness
Harness for interacting with a standard mat-button in tests.
Methods
async
blur
|
|
---|---|
Blurs the button. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
click
|
|
---|---|
Clicks the button. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the button. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getText
|
|
---|---|
Gets the button's label text. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the button is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the button is focused. |
|
Returns | |
Promise<boolean>
|
|
Interfaces
ButtonHarnessFilters
A set of criteria that can be used to filter a list of MatButtonHarness
instances.
Properties
Name | Description |
---|---|
|
Only find instances whose text matches the given value. |