Skip to content

feat(dialog): forward overlay props from content#11217

Open
chahatkesh wants to merge 1 commit into
shadcn-ui:mainfrom
chahatkesh:feat/base-dialog-overlay-props-11214
Open

feat(dialog): forward overlay props from content#11217
chahatkesh wants to merge 1 commit into
shadcn-ui:mainfrom
chahatkesh:feat/base-dialog-overlay-props-11214

Conversation

@chahatkesh

Copy link
Copy Markdown

What

Adds an overlayProps escape hatch to DialogContent and AlertDialogContent in the current Base UI and Radix registry sources.

Why

Base UI intentionally omits backdrops for nested dialogs. Its Backdrop supports forceRender, but the shadcn convenience content components hardcoded their overlays, so consumers could not reach that prop without recomposing the portal and content.

Before this change, passing overlayProps leaked the unknown prop to the popup DOM node and a nested dialog still rendered only one backdrop. After the change, overlayProps={{ forceRender: true }} renders the nested backdrop while preserving Base UI's default behavior when the prop is omitted.

Changes

  • forward overlayProps from Base UI Dialog and AlertDialog content to their overlays
  • mirror the content API in the Radix registry sources to preserve base parity
  • add jsdom regressions for nested Base UI Dialog and AlertDialog backdrops
  • document the opt-in on the Base UI component pages

Verification

  • pnpm exec vitest run apps/v4/registry/dialog.test.tsx (2 passed)
  • NODE_OPTIONS=--max-old-space-size=4096 pnpm --filter=v4 typecheck
  • pnpm --filter=v4 exec eslint registry/dialog.test.tsx registry/bases/base/ui/dialog.tsx registry/bases/base/ui/alert-dialog.tsx registry/bases/radix/ui/dialog.tsx registry/bases/radix/ui/alert-dialog.tsx
  • pnpm exec prettier --check on all touched files
  • pnpm --filter=v4 registry:build
  • pnpm --filter=v4 postinstall

Reviewer notes

  • Nested backdrop rendering remains opt-in; no default behavior changes.
  • Related PR fix(dialog): allow custom overlay props when controlling open state #8732 targets the legacy new-york-v4/deprecated registries for overlay styling and also includes app bootstrap changes. This PR targets the current Base/Radix source registries, covers AlertDialog, and validates Base UI forceRender with tests and docs.

Closes #11214

@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@chahatkesh is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@chahatkesh
chahatkesh force-pushed the feat/base-dialog-overlay-props-11214 branch from 0f7d1c5 to 204ee02 Compare July 18, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(dialog): enable nested dialog backdrops via Base UI forceRender on Backdrop

1 participant