Always render a DialogTitle: it gives the dialog its name. Render the trigger and the close buttons as a Button through render.
The sample also uses Button. One command adds them with this item:
release-notes-dialog.tsx
Dialog
| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From Base UIDialog.RootBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||
| open | boolean | — | Whether the dialog is currently open. | |||||||||||||||||||||||||||||||||||||||||
| default | boolean | false | Whether the dialog is initially open. To render a controlled dialog, use the open prop instead. | |||||||||||||||||||||||||||||||||||||||||
| modal | "trap-focus" | boolean | true | Determines if the dialog enters a modal state when open. - true: user interaction is limited to just the dialog: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled. - false: user interaction with the rest of the document is allowed. - 'trap-focus': focus is trapped inside the dialog, but document page scroll is not locked and pointer interactions outside of it remain enabled. When modal is true or 'trap-focus', render <Dialog.Close> inside <Dialog.Popup> so touch screen readers can escape the popup. | |||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
DialogTrigger
<button>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
From Base UIDialog.TriggerBase UI docs | |||||||||||||||||||||
| handle | DialogHandle<Payload> | — | A handle to associate the trigger with a dialog. Can be created with the Dialog.createHandle method. | ||||||||||||||||||
| payload | Payload | — | A payload to pass to the dialog when it is opened. | ||||||||||||||||||
| id | string | — | ID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot triggerId prop). | ||||||||||||||||||
| |||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||||||||||||||||
DialogPortal
<div>| Prop | Type | Default | Description |
|---|---|---|---|
From Base UIDialog.PortalBase UI docs | |||
| keep | boolean | false | Whether to keep the portal mounted in the DOM while the popup is hidden. |
| container | — | A parent element to render the portal element into. | |
| class | — | CSS class applied to the element, or a function that returns a class based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogOverlay
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIDialog.BackdropBase UI docs | |||
| force | boolean | false | Whether the backdrop is forced to render even when nested. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| scroll | "inside""outside" | — | |
| size | "default""lg""sm""xl" | — | |
| class | string | — | |
| backdrop | boolean | true | Dim the page under the dialog (Base UI Dialog.Backdrop). Default true. |
| show | boolean | true | Show the close button (a 24px ghost icon button) in the top end corner. Default true. |
| close | string | "Close" | The accessible name of the close button. Translate it with the page. |
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | |
| backdrop | DialogOverlayProps | — | |
| viewport | — | ||
| close | — | ||
From Base UIDialog.PopupBase UI docs | |||
| initial | — | Determines the element to focus when the dialog is opened. By default, focus moves to the first tabbable element inside the popup, except when the dialog is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard. - false: Do not move focus. - true: Move focus based on the default behavior (first tabbable element or popup). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing. | |
| final | — | Determines the element to focus when the dialog is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing. | |
| container | — | A parent element to render the portal element into. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogHeader
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogTitle
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogDescription
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogBody
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogFooter
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DialogClose
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Esc | Closes the dialog. |
|---|---|
| Tab | Moves the focus to the next element. The focus stays in the dialog. |
| ShiftTab | Moves the focus to the previous element. |
- Alert DialogPick Alert Dialog for one yes or no question before a destructive or blocking action, not for a form or a task.
- ButtonA button for an action on the page, such as Save or Delete. It has 9 looks and 5 sizes, and a spinner that keeps its width while the action runs.
- FormA form around its fields. It sets when every field checks its value, shows server errors on the right field, and gives your submit the values.
- DrawerPick Drawer for a panel that slides in from an edge and follows the finger, such as a side panel or a phone sheet.
- PopoverPick Popover for a small panel next to its button that does not block the rest of the page.









