Skip to main content

angular material - How to change Slide toggle label position

app.component.html

<h2 style="padding-top:25px; padding-bottom:25px;">
  Angular Material - How to change Slide toggle label position
</h2>


<h3>Storage access : {{slideToggleStorage.checked}}</h3>

<mat-slide-toggle 
  #slideToggleStorage 
  labelPosition="before">
    Allow us storage access
</mat-slide-toggle>


<h3 style="margin-top:40px;">
  Location access : {{slideToggleLocation.checked}}
</h3>

<mat-slide-toggle 
  #slideToggleLocation 
  labelPosition="after">
    Allow us location access
</mat-slide-toggle>
app.module.ts [import]

import { MatSlideToggleModule } from '@angular/material/slide-toggle'
More Angular tutorials