Home > Mobile >  Mat button toggle group component is not working
Mat button toggle group component is not working

Time:10-31

I am building an application which requires mat button toggle group (material component) and this is the code,

    <mat-button-toggle-group appearance="legacy" name="fontStyle" aria-label="Font Style">
        <mat-button-toggle value="bold">Bold</mat-button-toggle>
        <mat-button-toggle value="italic">Italic</mat-button-toggle>
        <mat-button-toggle value="underline">Underline</mat-button-toggle>
    </mat-button-toggle-group>

But, it's not displaying correctly. It's displaying like,

enter image description here

Could any one figure it out what's the problem?

CodePudding user response:

You need to import or define a theme for angular material, add the following import to your styles.css

@import '~@angular/material/prebuilt-themes/indigo-pink.css';
  • Related