components icon indicating copy to clipboard operation
components copied to clipboard

feat(dialog): set default actions alignment with injection token

Open json-derulo opened this issue 2 years ago • 2 comments

Feature Description

I want the dialog actions to be aligned to the right by default. Currently this is not part of the MatDialogConfig, so it cannot be set via the MAT_DIALOG_DEFAULT_OPTIONS injection token. It can only be achieved by setting the align input for each usage of the mat-dialog-actions component:

<mat-dialog-actions align="end">
</mat-dialog-actions>

My suggestion is to add an optional alignActions property to the MatDialogConfig interface to control the default alignment.

Use Case

The actions alignment should be changeable at a single point for the whole application, so it is easier to maintain in larger code bases.

json-derulo avatar Dec 18 '23 15:12 json-derulo

Since v19, this can be achieved with the overrides mixin:

@use '@angular/material' as mat;

:root {
  @include mat.dialog-overrides((
    actions-alignment: flex-end,
  ));
}

json-derulo avatar Mar 24 '25 09:03 json-derulo

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.