|
| 1 | +<h1>Default Slider</h1> |
| 2 | +Label <mat-slider #slidey aria-label="Basic slider"></mat-slider> |
| 3 | +{{slidey.value}} |
| 4 | + |
| 5 | +<h1>Colors</h1> |
| 6 | +<mat-slider color="primary" value="50" thumbLabel aria-label="Primary color slider"></mat-slider> |
| 7 | +<mat-slider color="accent" value="50" thumbLabel aria-label="Accent color slider"></mat-slider> |
| 8 | +<mat-slider color="warn" value="50" thumbLabel aria-label="Warn color slider"></mat-slider> |
| 9 | + |
| 10 | +<h1>Slider with Min and Max</h1> |
| 11 | +<input [(ngModel)]="min" type="number"> |
| 12 | +<mat-slider [min]="min" [max]="max" tickInterval="5" #slider2 aria-label="Min & max slider"> |
| 13 | +</mat-slider> |
| 14 | +{{slider2.value}} |
| 15 | +<input [(ngModel)]="max" type="number"> |
| 16 | + |
| 17 | +<h1>Disabled Slider</h1> |
| 18 | +<mat-slider disabled [(ngModel)]="disabledValue" [tickInterval]="1" aria-label="Disabled slider"> |
| 19 | +</mat-slider> |
| 20 | +<input [(ngModel)]="disabledValue" type="number"> |
| 21 | + |
| 22 | +<h1>Slider with set value</h1> |
| 23 | +<mat-slider value="43" aria-label="Initial value slider"></mat-slider> |
| 24 | + |
| 25 | +<h1>Slider with step defined</h1> |
| 26 | +<mat-slider min="1" max="100" step="20" #slider5 aria-label="Slider with step"></mat-slider> |
| 27 | +{{slider5.value}} |
| 28 | + |
| 29 | +<h1>Slider with set tick interval</h1> |
| 30 | +<mat-slider tickInterval="auto" aria-label="Slider with auto ticks"></mat-slider> |
| 31 | +<mat-slider tickInterval="9" aria-label="Slider with ticks"></mat-slider> |
| 32 | + |
| 33 | +<h1>Slider with Thumb Label</h1> |
| 34 | +<mat-slider thumbLabel aria-label="Slider with thumb label"></mat-slider> |
| 35 | + |
| 36 | +<h1>Slider with one-way binding</h1> |
| 37 | +<mat-slider [value]="val" step="40" aria-label="Slider with value binding"></mat-slider> |
| 38 | +<input [(ngModel)]="val" type="number"> |
| 39 | + |
| 40 | +<h1>Slider with two-way binding</h1> |
| 41 | +<mat-slider [(ngModel)]="demo" step="40" aria-label="Slider with ngModel"></mat-slider> |
| 42 | +<input [(ngModel)]="demo" type="number"> |
| 43 | + |
| 44 | +<h1>Set/lost focus to show thumblabel programmatically</h1> |
| 45 | +<mat-slider #demoSlider="matSlider" thumbLabel aria-label="Slider with thumb label"></mat-slider> |
| 46 | +<button (click)="demoSlider.focus()">Focus Slider</button> |
| 47 | +<button (click)="demoSlider.blur()">Blur Slider</button> |
| 48 | + |
| 49 | +<mat-tab-group> |
| 50 | + <mat-tab label="One"> |
| 51 | + <mat-slider min="1" max="5" value="3" aria-label="Slider in a tab"></mat-slider> |
| 52 | + </mat-tab> |
| 53 | +</mat-tab-group> |
0 commit comments