Uh oh!
There was an error while loading. Please reload this page.
Dialog: Support custom width values - #7831
Conversation
🦋 Changeset detectedLatest commit: af7ff49 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
There was a problem hiding this comment.
Pull request overview
Extends @primer/react’s Dialogwidth prop beyond the existing named sizes so consumers can provide custom CSS width values without relying on !important overrides.
Changes:
- Updated
DialogWidthtyping and runtime behavior to support custom widths via a--dialog-widthCSS custom property. - Updated
Dialogstyles to usewidth: var(--dialog-width, 640px)as the baseline. - Added tests, Storybook control updates, a new feature story, docs updates, and a minor changeset.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Dialog/Dialog.tsx | Expands width typing and sets data-width only for named sizes; injects --dialog-width for custom widths. |
| packages/react/src/Dialog/Dialog.module.css | Switches default width to a CSS variable with a fallback, enabling custom width injection. |
| packages/react/src/Dialog/Dialog.test.tsx | Adds coverage for named-size data-width behavior and custom-string width via --dialog-width. |
| packages/react/src/Dialog/Dialog.stories.tsx | Updates Storybook control for width to text and describes custom width usage. |
| packages/react/src/Dialog/Dialog.features.stories.tsx | Adds a “CustomWidth” feature story demonstrating a custom width value. |
| packages/react/src/Dialog/Dialog.docs.json | Updates generated prop docs to reflect custom width support. |
| .changeset/tall-impalas-wash.md | Declares a minor release for the new Dialog width capability. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 3
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
A successful canary CI run (i.e., a valid canary version published via the Next steps:
For more details, see this workflow run. |
liuliu-dev
commented
May 14, 2026
integration tests are passed but PR status not updated, skip manually. |
Closeshttps://github.com/github/core-ux/issues/2489
Changelog
The Dialog
widthprop currently only accepts named sizes (small,medium,large,xlarge). This forces consumers who need non-standard widths to use!importantCSS overrides .This PR extends the
widthprop to also accept any valid CSS width value (string or number).Before:
After:
Rollout strategy
Testing & Reviewing
Merge checklist