Alert Dialog
A dialog that requires user response to proceed.
API reference
Import the component and place its parts the following way:
Anatomy
import { AlertDialog } from '@base-ui-components/react/alert-dialog';
<AlertDialog.Root>
<AlertDialog.Trigger />
<AlertDialog.Backdrop />
<AlertDialog.Popup>
<AlertDialog.Title />
<AlertDialog.Description />
<AlertDialog.Close />
</AlertDialog.Popup>
</AlertDialog.Root>
Root
Prop | Type | Default | |
---|---|---|---|
defaultOpen | boolean | false | |
onOpenChange | (open, event) => void | undefined | |
open | boolean | undefined |
Trigger
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
render | | React.ReactElement | undefined |
Backdrop
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
container | React.Ref | HTMLElement | null | false | |
keepMounted | boolean | false | |
render | | React.ReactElement | undefined |
Popup
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
container | React.Ref | HTMLElement | null | undefined | |
finalFocus | React.Ref | undefined | |
initialFocus | | React.Ref | undefined | |
keepMounted | boolean | false | |
render | | React.ReactElement | undefined |
Title
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
render | | React.ReactElement | undefined |
Description
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
render | | React.ReactElement | undefined |