Homecomponentsstructural
Alpha
This component is in development. There could be breaking changes made to it in a non-major release of Prism. Please use with caution.Use AlertDialog to ask user's confirmation on important actions. It requires a title, description, and a primary action.
Opening the dialog
There are two ways to open the dialog. The first one is to use a trigger element which will be rendered and will trigger the dialog when tapped upon.
The other way is to use state to show or hide the dialog. This requires using open and onChange.
Prefer to use trigger whenever the dialog is opened by an interface element. This provides an accessibility affordance of returning the focus back to the trigger after the dialog is dismissed.
Size
Use the size property to control size of the alert dialog.
Customizing the secondary action
You can use the secondaryAction property to set a custom secondary action.
API
title
Required
string
description
Required
string
primaryAction
Required
AlertDialogAction
open
true
false
onChange
((open: boolean) => void)
onClose
(() => void)
trigger
ReactNode
secondaryAction
AlertDialogSecondaryAction
size
medium
large
small
fluid