import {MatSlideToggleModule} from '@angular/material/slide-toggle';
MatSlideToggle
Represents a slidable "switch" toggle that can be moved between on and off.
Selector: mat-slide-toggle
Exported as: matSlideToggleName | Description |
---|---|
@Input('aria-label')
| Whether the slide-toggle element is checked or not Used to set the aria-label attribute on the underlying input element. |
@Input('aria-labelledby')
| Used to set the aria-labelledby attribute on the underlying input element. |
@Input()
| Whether the slide-toggle element is checked or not |
@Input()
| Theme color palette for the component. |
@Input()
| Whether ripples are disabled. |
@Input()
| Whether the component is disabled. |
@Input()
| A unique id for the slide-toggle input. If none is supplied, it will be auto-generated. |
@Input()
| Whether the label should appear after or before the slide-toggle. Defaults to 'after' |
@Input()
| Name value will be applied to the input element if present |
@Input()
| Whether the slide-toggle is required. |
@Output()
| An event will be dispatched each time the slide-toggle changes its value. |
@Output()
| An event will be dispatched each time the slide-toggle is dragged. This event always fire when user drag the slide toggle to make a change that greater than 50%. It does not mean the slide toggle's value is changed. The event does not fire when user toggle the slide toggle to change the slide toggle's value. |
@Output()
| An event will be dispatched each time the slide-toggle input is toggled. This event always fire when user toggle the slide toggle, but does not mean the slide toggle's value is changed. The event does not fire when user drag to change the slide toggle value. |
| |
| Returns the unique id for the visual hidden input. |
focus | |
---|---|
Focuses the slide-toggle. |
toggle | |
---|---|
Toggles the checked state of the slide-toggle. |
MatSlideToggleChange
Change event object emitted by a MatSlideToggle.
Name | Description |
---|---|
| The new |
| The source MatSlideToggle of the event. |
MatSlideToggleDefaultOptions
Default mat-slide-toggle
options that can be overridden.
Name | Description |
---|---|
| Whether drag action triggers value changes in slide toggle. |
| Whether toggle action triggers value changes in slide toggle. |