AlertDialog
Modal dialog requiring user confirmation
Accessibility
- Ensure the trigger, popup role, and focus return behavior all describe the same interaction model.
- Provide an obvious keyboard dismissal path and avoid putting essential actions in hover-only content.
- Keep the opening control labeled, ensure focus moves predictably on open and close, and expose the popup type truthfully.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<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
ts
import { AlertDialog } from '@dryui/ui' Per-component subpath
ts
import { AlertDialog } from '@dryui/ui/alert-dialog' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
AlertDialog.Root | |||||
| open | boolean | Whether the overlay or disclosure is currently open. | false | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
AlertDialog.Trigger | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
AlertDialog.Content | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
AlertDialog.Overlay | |||||
AlertDialog.Header | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
AlertDialog.Body | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
AlertDialog.Footer | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
AlertDialog.Action | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
AlertDialog.Cancel | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |