AlertDialog component is used to interrupt the user with a mandatory confirmation or event. The component will appear in front of the page prompting the user to conplete an event.
class AlertDialogState(rx.State):
show: bool = False
def change(self):
self.show = not (self.show)
def alertdialog_example():
return rc.vstack(
rc.button(
"Show Alert Dialog",
on_click=AlertDialogState.change,
),
rc.alert_dialog(
rc.alert_dialog_overlay(
rc.alert_dialog_content(
rc.alert_dialog_header("Confirm"),
rc.alert_dialog_body(
"Do you want to confirm example?"
),
rc.alert_dialog_footer(
rc.button(
"Close",
on_click=AlertDialogState.change,
)
),
)
),
is_open=AlertDialogState.show,
),
width="100%",
)
rc.AlertDialog
Provides context and state for the dialog.
rc.AlertDialogOverlay
The dimmed overlay behind the dialog.
Props
No component specific props
Event Triggers
See the full list of default event triggersrc.AlertDialogContent
The wrapper for the alert dialog's content.
Props
No component specific props
Event Triggers
See the full list of default event triggersrc.AlertDialogHeader
Should contain the title announced by screen readers.
Props
No component specific props
Event Triggers
See the full list of default event triggersrc.AlertDialogBody
Should contain the description announced by screen readers.
Props
No component specific props
Event Triggers
See the full list of default event triggersrc.AlertDialogFooter
Should contain the events of the dialog.
Props
No component specific props