class ModalState(rx.State):
show: bool = False
def change(self):
self.show = not (self.show)
rx.box(
rx.button("Confirm", on_click=ModalState.change),
rx.modal(
rx.modal_overlay(
rx.modal_content(
rx.modal_header("Confirm"),
rx.modal_body(
"Do you want to confirm example?"
),
rx.modal_footer(
rx.button(
"Close", on_click=ModalState.change
)
),
)
),
is_open=ModalState.show,
),
)
The wrapper that provides context for its children.
The wrapper that houses the modal's main content.
The header that labels the modal dialog.
The footer that houses the modal events.
The container for the modal dialog's content.
The dimmed overlay behind the modal dialog.