tsimport {XDSAlertDialog} from '@xds/core/AlertDialog'
| Guidance | Practices |
|---|---|
| Do | Make the action button label specific — "Delete project" is better than "OK" or "Confirm". |
| Do | Describe what will happen in the description so the user knows the consequences before confirming. |
| Don't | Use AlertDialog for non-destructive actions — use a standard Dialog instead. |
| Prop | Type | Description |
|---|---|---|
isOpenrequired | boolean | Whether the dialog is open. |
onOpenChangerequired | (isOpen: boolean) => unknown | Visibility change callback. |
titlerequired | string | Dialog title. Linked via aria-labelledby. |
descriptionrequired | string | Consequence description. Linked via aria-describedby. |
actionLabelrequired | string | Action button label. |
onActionrequired | () => unknown | Called when action button is clicked. Does NOT auto-close. |
cancelLabel | string (default: 'Cancel') | Cancel button label. |
actionVariant | XDSButtonVariant (default: 'destructive') | Action button variant. |
isActionLoading | boolean | Shows loading spinner on the action button. |
width | number | string (default: 400) | Dialog width. |
isInline | boolean (default: false) | Renders alert dialog content inline without modal behavior. For documentation previews and showcases only. |
| Prop | Type | Description |
|---|---|---|
show | (options: AlertDialogOptions) => void | Show the alert dialog with the given options. Options are the same as XDSAlertDialog props minus isOpen/onOpenChange. |
hide | () => void | Hide the alert dialog. |
isOpen | boolean | Whether the dialog is currently open. |
element | ReactNode | The dialog element — render this in your JSX tree. |