Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-icons-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Add `sx` prop to Dialog v2
4 changes: 3 additions & 1 deletion src/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type DialogButtonProps = ButtonProps & {
/**
* Props to customize the rendering of the Dialog.
*/
export interface DialogProps {
export interface DialogProps extends SxProp {
/**
* Title of the Dialog. Also serves as the aria-label for this Dialog.
*/
Expand Down Expand Up @@ -262,6 +262,7 @@ const _Dialog = React.forwardRef<HTMLDivElement, React.PropsWithChildren<DialogP
width = 'xlarge',
height = 'auto',
footerButtons = [],
sx,
} = props
const dialogLabelId = useId()
const dialogDescriptionId = useId()
Expand Down Expand Up @@ -301,6 +302,7 @@ const _Dialog = React.forwardRef<HTMLDivElement, React.PropsWithChildren<DialogP
role={role}
aria-labelledby={dialogLabelId}
aria-describedby={dialogDescriptionId}
sx={sx}
>
{header}
{body}
Expand Down