AlertDialog
Modal dialog requiring user confirmation
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { AlertDialog } from '@dryui/ui';
</script>
<AlertDialog.Root>
<AlertDialog.Trigger>...</AlertDialog.Trigger>
<AlertDialog.Content>...</AlertDialog.Content>
<AlertDialog.Overlay>...</AlertDialog.Overlay>
<AlertDialog.Header>...</AlertDialog.Header>
<AlertDialog.Body>...</AlertDialog.Body>
<AlertDialog.Footer>...</AlertDialog.Footer>
<AlertDialog.Action>...</AlertDialog.Action>
<AlertDialog.Cancel>...</AlertDialog.Cancel>
</AlertDialog.Root>Import options
Root package
import { AlertDialog } from '@dryui/ui'Per-component subpath
import { AlertDialog } from '@dryui/ui/alert-dialog'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
Confirmation Dialog
<AlertDialog.Root>
<AlertDialog.Trigger><Button variant="solid">Delete Account</Button></AlertDialog.Trigger>
<AlertDialog.Overlay />
<AlertDialog.Content>
<AlertDialog.Header>Are you absolutely sure?</AlertDialog.Header>
<AlertDialog.Body>
<p>This action cannot be undone. This will permanently delete your account and remove your data from our servers.</p>
</AlertDialog.Body>
<AlertDialog.Footer>
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
<AlertDialog.Action>Yes, delete account</AlertDialog.Action>
</AlertDialog.Footer>
</AlertDialog.Content>
</AlertDialog.Root>Structure
Compound components always start with AlertDialog.Root. Use this structure block to understand required wrappers before you wire state or styling.
AlertDialog.Root AlertDialog.Trigger AlertDialog.Content AlertDialog.Overlay AlertDialog.Header AlertDialog.Body AlertDialog.Footer AlertDialog.Action AlertDialog.Cancel
Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
Compound component. Start with AlertDialog.Root, then add only the parts you need.
AlertDialog.Root
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
open | boolean | false | — | — |
children | Snippet | — | ✓ | — |
Also accepts standard HTML attributes (class, style, id, etc.)
AlertDialog.Trigger
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
AlertDialog.Content
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards native HTML attributes via rest props.
AlertDialog.Overlay
| Prop | Type | Default | Required | Bindable |
|---|
Forwards <div> attributes via rest props. Common examples: id, style, role.
AlertDialog.Header
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
AlertDialog.Body
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
AlertDialog.Footer
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
AlertDialog.Action
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <button> attributes via rest props. Common examples: type, disabled, name.
AlertDialog.Cancel
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <button> attributes via rest props. Common examples: type, disabled, name.