AlertDialog

Confirmation dialog for destructive or important actions. Requires explicit user acknowledgment before proceeding.

Example

Props

AlertDialog.Root

PropTypeDefaultDescription
openbooleanfalseControls dialog visibility (bindable)
childrenSnippetDialog content

AlertDialog.Trigger

PropTypeDefaultDescription
classstringAdditional CSS classes
childrenSnippetTrigger content

AlertDialog.Content

PropTypeDefaultDescription
classstringAdditional CSS classes
childrenSnippetDialog body content

AlertDialog.Title / AlertDialog.Description

PropTypeDefaultDescription
classstringAdditional CSS classes
childrenSnippetText content

AlertDialog.Action / AlertDialog.Cancel

PropTypeDefaultDescription
classstringAdditional CSS classes
childrenSnippetButton content

Usage

<script>
  import { AlertDialog, Button } from '@chrissnell/chonky-ui';
</script>

<AlertDialog.Root>
  <AlertDialog.Trigger>
    <Button variant="danger">Delete</Button>
  </AlertDialog.Trigger>
  <AlertDialog.Content>
    <AlertDialog.Title>Are you sure?</AlertDialog.Title>
    <AlertDialog.Description>This action cannot be undone.</AlertDialog.Description>
    <div style="display: flex; gap: 0.5rem; justify-content: flex-end;">
      <AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
      <AlertDialog.Action>Delete</AlertDialog.Action>
    </div>
  </AlertDialog.Content>
</AlertDialog.Root>