material-components / material-components/material-components-android

[MaterialAlertDialog] Custom spacing between action buttons and content

Open
#4,981 0 comments 0 reactions 1 assignee View on GitHub

@hunterstich is already working on this.

Since Feb 24, 2026.

feature request Widget: Dialog
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

For a simple dialog with a single line of text there is way too much of a gap between message and action buttons.

I could reduced the spacing a bit using:

    <dimen name="m3_alert_dialog_action_top_padding" tools:override="true">0dp</dimen>

Original spacing:

Image

Reduced spacing:

Image

That's still much spacing but tolerable I guess.

Things could be improved further if we could override the minHeight from contentPanel in m3_alert_dialog.xml which is currently hardcoded to 48dp.


See https://github.com/material-components/material-components-android/issues/4345#issuecomment-3592444076.

I guess we would need something like:

<dimen name="m3_alert_dialog_content_min_height">48dp</dimen>

That would allow apps to override it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.