import {MatSliderModule} from '@angular/material/slider';
MatSlider
Allows users to select from a range of values by moving the slider thumb. It is similar in
behavior to the native <input type="range">
element.
Selector: mat-slider
Exported as: matSliderName | Description |
---|---|
@Input()
|
Theme color of the slider. This API is supported in M2 themes only, it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/slider/styling. For information on applying color variants in M3, see https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants |
@Input({ transform: booleanAttribute })
|
Whether ripples are disabled in the slider. |
@Input({ transform: booleanAttribute })
|
Whether the slider is disabled. |
@Input({ transform: booleanAttribute })
|
Whether the slider displays a numeric value label upon pressing the thumb. |
@Input()
|
Function that will be used to format the value before it is displayed in the thumb label. Can be used to format very large number in order for them to fit into the slider thumb. |
@Input({ transform: numberAttribute })
|
The maximum value that the slider can have. |
@Input({ transform: numberAttribute })
|
The minimum value that the slider can have. |
@Input({ transform: booleanAttribute })
|
Whether the slider displays tick marks along the slider track. |
@Input({ transform: numberAttribute })
|
The values at which the thumb will snap. |
MatSliderThumb
Directive that adds slider-specific behaviors to an input element inside <mat-slider>
.
Up to two may be placed inside of a <mat-slider>
.
If one is used, the selector matSliderThumb
must be used, and the outcome will be a normal
slider. If two are used, the selectors matSliderStartThumb
and matSliderEndThumb
must be
used, and the outcome will be a range slider with two slider thumbs.
Selector: input[matSliderThumb]
Exported as: matSliderThumbName | Description |
---|---|
@Input({ transform: numberAttribute })
|
|
@Output()
|
Event emitted when the slider thumb stops being dragged. |
@Output()
|
Event emitted when the slider thumb starts being dragged. |
@Output()
|
Event emitted when the |
|
The percentage of the slider that coincides with the value. |
|
blur |
---|
focus |
---|
MatSliderRangeThumb
extends
MatSliderThumb
Selector: input[matSliderStartThumb] input[matSliderEndThumb]
Exported as: matSliderRangeThumbName | Description |
---|---|
@Input({ transform: numberAttribute })
|
|
@Output()
|
Event emitted when the slider thumb stops being dragged. |
@Output()
|
Event emitted when the slider thumb starts being dragged. |
@Output()
|
Event emitted when the |
|
The percentage of the slider that coincides with the value. |
|
blur |
---|
focus |
---|
MatSliderChange
A simple change event emitted by the MatSlider component.
Name | Description |
---|---|
|
The MatSlider that was interacted with. |
|
The MatSliderThumb that was interacted with. |
|
The new value of the source slider. |
MatSliderDragEvent
Represents a drag event emitted by the MatSlider component.
Name | Description |
---|---|
|
The MatSlider that was interacted with. |
|
The MatSliderThumb that was interacted with. |
|
The current value of the slider. |