Alert Dialog

The main alert dialog component.

Read more Read less

Options

  • :id - Required unique identifier for the alert dialog.
  • :open - Whether the alert dialog is initially open. Defaults to false.
  • :on-open - Handler for alert dialog open event.
  • :on-close - Handler for alert dialog close event.
  • :class - Additional CSS classes.
Attribute Type Documentation Default Value
Required id * :string

Unique identifier for the alert dialog

open :boolean

Whether the alert dialog is initially open

false
on-open :any

Handler for alert dialog open event

on-close :any

Handler for alert dialog close event

class :string
rest :global
Required inner_block * :slot
<.alert_dialog_trigger>
  <.button variant="destructive">Delete Account</.button>
</.alert_dialog_trigger>
<.alert_dialog_content>
  <.alert_dialog_header>
    <.alert_dialog_title>Delete Account</.alert_dialog_title>
    <.alert_dialog_description>
      Are you sure you want to delete your account? All of your data
      will be permanently removed. This action cannot be undone.
    </.alert_dialog_description>
  </.alert_dialog_header>
  <.alert_dialog_footer>
    <.alert_dialog_cancel>Cancel</.alert_dialog_cancel>
    <.alert_dialog_action variant="destructive">Delete</.alert_dialog_action>
  </.alert_dialog_footer>
</.alert_dialog_content>