Skip to main content

angular material - How to show thumb label in Slider

app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styles: [`
    mat-slider{
      width: 400px;
    }
  `]
})


export class AppComponent { 
  value:number = 0;
}
app.component.html

<h2 style="padding-top:25px; padding-bottom:25px;">
    Angular Material - How to show thumb label in Slider
</h2>


<h3>Selected Value : {{value}}</h3>

<mat-slider 
    [(ngModel)]="value"
    thumbLabel="true">
</mat-slider>
app.module.ts [import]

import { MatSliderModule } from '@angular/material/slider';
import { FormsModule } from '@angular/forms';
More Angular tutorials