Skip to content

feat(dialog)!: replace children with title, content and actions props - #5072

Merged
Doberjohn merged 25 commits into
callstack:mainfrom
kachmashk:refactor/dialog-improvements
Nov 17, 2026
Merged

Doberjohn merged 25 commits into
callstack:mainfrom
kachmashk:refactor/dialog-improvements

Conversation

@kachmashk

@kachmashk kachmashk commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Brings Dialog to the Material 3 spec and replaces its compound children with props, as #4933 proposes. Dialog takes icon, title, content and actions, plus scrollable for long content. It is 280dp to 560dp wide and centered, centers the title under an icon, and moves the scroll area divider to outlineVariant.

Breaking: Dialog no longer renders children. The Dialog section of the migration guide shows the move.

Related issue

#4933

Screenshots / Videos

Web at 1280px, before and after
Phone, before and after

Test plan

In the example app, open each dialog on the Dialog screen on web, iOS and Android, in portrait and landscape, and once with RTL on.

Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread docs/src/data/componentDocs6x.json Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread docs/src/data/componentDocs6x.json Resolved
Comment thread src/components/Dialog/DialogActions.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/DialogTitle.tsx Resolved
Comment thread src/components/Modal.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread docs/src/data/componentDocs6x.json Resolved
@kachmashk
kachmashk requested a review from JKobrynski September 1, 2026 08:40
@kachmashk
kachmashk force-pushed the refactor/dialog-improvements branch from 8562995 to 7be180f Compare September 2, 2026 08:36
@JKobrynski

JKobrynski commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

The MD3 corrections here should all land - divider colour, the 280/560 width clamp, the icon margin, the centred headline. What I'd like to reconsider is replacing children with title/content/actions props. #5076 solves the same problem while keeping the sub-components, which matches Card, List and DataTable. Could you drop the API change and keep the MD3 fixes? #5076 will need to land first either way, since the two touch the same files. @kachmashk

Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread docs/6.x/docs/guides/migration.md Resolved
Comment thread docs/6.x/docs/guides/migration.md Resolved
Comment thread src/components/Modal.tsx Resolved
@JKobrynski

Copy link
Copy Markdown
Collaborator

Also @kachmashk could you resolve the comments that've been addressed? 🙏

@kachmashk

Copy link
Copy Markdown
Collaborator Author

Waiting for a #5076 to be closed.

@JKobrynski

Copy link
Copy Markdown
Collaborator

#5094 removes docs from the repo, can you remove them from this PR? 🙏

@JKobrynski

Copy link
Copy Markdown
Collaborator

@kachmashk ☝️ and we've got conflicts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@k0ndee

k0ndee commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Heads up - #5125 is reworking Modal's accessibility props: it replaces overlayAccessibilityLabel with aria-label, and adds a new configurable role prop (defaulting to dialog) directly on Modal's Surface, rather than a hardcoded value. This PR already forwards aria-label from Dialog to Modal, but its Modal usage here still targets the old shape (overlayAccessibilityLabel + hardcoded role="dialog"), so it'll need a rebase once #5125 merges.

konstmar pushed a commit to konstmar/react-native-paper that referenced this pull request Sep 17, 2026
The surface stays a dialog, but the prop lands together with the Dialog
wiring in callstack#5072 rather than half-done here.
@satya164

Copy link
Copy Markdown
Contributor

Review by Claude

The new maxWidth: 560 keeps the dialog stretched from the start edge, so on any screen wider than about 612 points the dialog sits against one side instead of the center. Phones in portrait are not affected.

Web

Steps: open the example app at 1280px width, go to Dialog, press "With icon".
What happens: the dialog is 560px wide and starts at x=26, so it hugs the left edge.
What should happen: the dialog is centered horizontally. (via Claude, verify if it makes sense)

Web, 1280px wide: dialog pinned to the left edge

iOS

Steps: rotate the device to landscape, go to Dialog, press "With icon".
What happens: the dialog starts at the left safe area inset and leaves a wide gap on the right.
What should happen: the dialog is centered horizontally. (via Claude, verify if it makes sense)

iOS, landscape: dialog pinned to the left edge

Android

Steps: turn on RTL in the drawer, rotate the device to landscape, go to Dialog, press "With icon".
What happens: the dialog sticks to the right edge, which is the start edge in RTL.
What should happen: the dialog is centered horizontally. (via Claude, verify if it makes sense)

Android, landscape, RTL: dialog pinned to the right edge

@satya164 satya164 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Claude

See the inline comments. Also, no test covers the new icon prop or the centered title when an icon is present. A test that renders icon with title and checks textAlign: 'center' on the title would catch a regression. (via Claude, verify if it makes sense)

Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/DialogActions.tsx Resolved
Comment thread src/components/Dialog/DialogActions.tsx Resolved
Comment thread docs/6.x/docs/guides/migration.md Resolved
@Doberjohn Doberjohn added this to the 6.0.0 milestone Oct 30, 2026
@Doberjohn Doberjohn modified the milestones: 6.0.0, 6.0.0-beta.0 Nov 12, 2026
@kachmashk
kachmashk force-pushed the refactor/dialog-improvements branch 2 times, most recently from 4f7fa68 to 1ef4e76 Compare November 12, 2026 15:04
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
Comment thread src/components/Dialog/Dialog.tsx Resolved
@kachmashk
kachmashk force-pushed the refactor/dialog-improvements branch from 7a23784 to 687c821 Compare November 16, 2026 12:13

@Stoneski93 Stoneski93 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes! Could you add tests for them? One for an icon without a title (content shouldn't get marginTop: 24), one for an icon with a title (title has textAlign: 'center'), and one for titleProps overriding the title style.

@kachmashk
kachmashk force-pushed the refactor/dialog-improvements branch from 87a8236 to 2fbe044 Compare November 17, 2026 11:25
With children gone, Dialog.Icon, Dialog.Title, Dialog.Content,
Dialog.Actions and Dialog.ScrollArea had no supported place: content is
already wrapped in Dialog.Content. Drop the statics and their docs pages,
and test the actions through the actions prop.
Say that Dialog.Icon, Dialog.Title, Dialog.Content, Dialog.Actions and
Dialog.ScrollArea were removed, map Dialog.ScrollArea to scrollable, and
retitle the Dialog.Actions section now that the part is gone.
DialogActionsProps and DialogIconProps describe nothing public now that
the parts are internal. The parts' screenshots and theme color entries
have no docs page left, so fold the icon and divider colors into
Dialog's entry, which now names the container's surfaceContainerHigh.
@Doberjohn
Doberjohn merged commit 655fbcc into callstack:main Nov 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants