Skip to content
+

Alert Dialog

Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks.

AlertDialogBackdrop API

Import

import * as AlertDialog from '@base_ui/react/AlertDialog';
const AlertDialogBackdrop = AlertDialog.Backdrop;

Props

Props of the native component are also available.

NameTypeDefaultDescription
classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

keepMountedboolfalse

If true, the backdrop element is kept in the DOM when closed.

renderelement
| func
-

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use AlertDialogBackdrop to change the default props of this component with the theme.

AlertDialogClose API

Import

import * as AlertDialog from '@base_ui/react/AlertDialog';
const AlertDialogClose = AlertDialog.Close;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use AlertDialogClose to change the default props of this component with the theme.

AlertDialogDescription API

Import

import * as AlertDialog from '@base_ui/react/AlertDialog';
const AlertDialogDescription = AlertDialog.Description;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use AlertDialogDescription to change the default props of this component with the theme.

AlertDialogPopup API

Import

import * as AlertDialog from '@base_ui/react/AlertDialog';
const AlertDialogPopup = AlertDialog.Popup;

Props

Props of the native component are also available.

NameTypeDefaultDescription
classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

containerHTML element
| ref
-

The container element to which the popup is appended to.

keepMountedboolfalse

If true, the dialog element is kept in the DOM when closed.

renderelement
| func
-

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use AlertDialogPopup to change the default props of this component with the theme.

AlertDialogRoot API

Import

import * as AlertDialog from '@base_ui/react/AlertDialog';
const AlertDialogRoot = AlertDialog.Root;

Props

Props of the native component are also available.

NameTypeDefaultDescription
animatedbooltrue

If true, the dialog supports CSS-based animations and transitions. It is kept in the DOM until the animation completes.

defaultOpenbool-

Determines whether the dialog is initally open. This is an uncontrolled equivalent of the open prop.

onOpenChangefunc-

Callback invoked when the dialog is being opened or closed.

openbool-

Determines whether the dialog is open.


The component cannot hold a ref.

AlertDialogTitle API

Import

import * as AlertDialog from '@base_ui/react/AlertDialog';
const AlertDialogTitle = AlertDialog.Title;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use AlertDialogTitle to change the default props of this component with the theme.

AlertDialogTrigger API

Import

import * as AlertDialog from '@base_ui/react/AlertDialog';
const AlertDialogTrigger = AlertDialog.Trigger;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use AlertDialogTrigger to change the default props of this component with the theme.