I can add a custom class to a MatDialog this way:
this.dialog.open(MyGreatDialogComponent, {
data: myGreatData,
panelClass: 'my-great-class',
});
Is it possible to add an additional class(es) to a Material dialog?
I can add a custom class to a MatDialog this way:
this.dialog.open(MyGreatDialogComponent, {
data: myGreatData,
panelClass: 'my-great-class',
});
Is it possible to add an additional class(es) to a Material dialog?
Share Improve this question asked Apr 13, 2021 at 0:06 Tony BrasunasTony Brasunas 4,5923 gold badges46 silver badges57 bronze badges 2- 1 add typings to your project so you can immediately see such things panelClass?: string | string[]; – Petr Averyanov Commented Apr 13, 2021 at 1:06
- Thanks! Obvious, I guess. Just answered my own question in case someone else comes looking for it, so as not to waste anyone's time, as this wasn't posted anywhere else. – Tony Brasunas Commented Apr 13, 2021 at 1:16
1 Answer
Reset to default 25Quite simple to use an array of classes:
this.dialog.open(MyGreatDialogComponent, {
data: myGreatData,
panelClass: ['my-great-class', 'my-other-great-class'],
});