✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

AlertDialog


AlertDialog component is used to interrupt the user with a mandatory confirmation or event. When used a alertdialog 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)


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,
    ),
)

AlertDialog


Provides context and state for the dialog.


AlertDialogBody


Should contain the description announced by screen readers.


  • No props for AlertDialogBody.

  • Base Event Triggers

AlertDialogHeader


Should contain the title announced by screen readers.


  • No props for AlertDialogHeader.

  • Base Event Triggers

AlertDialogFooter


Should contain the events of the dialog.


  • No props for AlertDialogFooter.

  • Base Event Triggers

AlertDialogContent


The wrapper for the alert dialog's content.


  • No props for AlertDialogContent.

  • Base Event Triggers

AlertDialogOverlay


The dimmed overlay behind the dialog.


  • No props for AlertDialogOverlay.

  • Base Event Triggers

← IconDrawer →

Copyright © 2023 Pynecone, Inc.