Dialog

Displays a modal window above the page contents.

This component inherits parts and props from the Radix Dialog primitive. View source

Contains all the parts of a dialog.

Wraps the control that will open the dialog.

Contains content to be rendered in the open dialog. This component is based on the div element.

PropTypeDefault
size '1' | '2' | '3' | '4' | '5' | '6'

The size prop will map to the following widths:

SizeMax Width
1430px
2530px
3600px
4680px
5780px
6900px
PropTypeDefault
titleReact.ReactNoderequired
descriptionReact.ReactNode
errorReact.ReactNode
childrenReact.ReactNodenull

Contains the main content of the dialog – it has a built-in scroll area that is only visible when the content is too big to fit in the dialog.

Contains the actions of the dialog.

Wraps the control that will close the dialog.

The Title component is deprecated and it should be used only on very specific cases. Use the title prop instead.

An accessible title that is announced when the dialog is opened. This part is based on the Heading component with a pre-defined font size and leading trim on top.

The Description component is deprecated and it should be used only on very specific cases. Use the description prop instead.

An optional accessible description that is announced when the dialog is opened. This part is based on the Text component with a pre-defined font size.

If you want to remove the description entirely, remove this part and pass aria-describedby={undefined} to Dialog.Content.

Use the size prop in the Content component to control the maxWidth of the dialog. If you have a very specific case, you can still pass a custom maxWidth prop to override the size.

Use the Inset component to create a container that ignores the Content part padding. If needed, you can recreate the original padding by setting the Inset part’s padding props to "current".

Whenever the body of the dialog is bigger than the dialog itself, it will show a scrollbar automatically.

This is now deprecated. You should combine the Header, Body and Footer parts to create a scrollable content. So this example is only for reference as most of our dialogs in the dashboard still use this type of dialog.