class AlertDialogState(rx.State):
show: bool = False
def change(self):
self.show = not (self.show)
rx.box(
rx.button(
"Show Alert Dialog",
on_click=AlertDialogState.change,
),
rx.alert_dialog(
rx.alert_dialog_overlay(
rx.alert_dialog_content(
rx.alert_dialog_header("Confirm"),
rx.alert_dialog_body(
"Do you want to confirm example?"
),
rx.alert_dialog_footer(
rx.button(
"Close",
on_click=AlertDialogState.change,
)
),
)
),
is_open=AlertDialogState.show,
),
)
Provides context and state for the dialog.
Should contain the description announced by screen readers.
Should contain the title announced by screen readers.
Should contain the events of the dialog.
The wrapper for the alert dialog's content.
The dimmed overlay behind the dialog.