Check out example codes for "mat slide toggle button". It will help you in understanding the concepts better.

Code Example 1

import {MatSlideToggleModule} from '@angular/material/slide-toggle';

<mat-slide-toggle>Slide me!</mat-slide-toggle>

Learn ReactJs, React Native from akashmittal.com