Installation
CLI
Install the component using the StarUI CLI:
Examples
Rich Content
Icons, consequence lists, and Card composition for a danger zone pattern
Danger Zone
Irreversible actions
Delete Repository
Once deleted, it will be gone forever
Reactive Content
Using action callbacks to reset signals — multi-button footer with live data preview
Document Editor
Edit your document details
Make changes to the document fields above and try to save.
Programmatic Open
Opening the dialog from JavaScript via the signal prop — no trigger click needed
Session Demo
Programmatic dialog open via signal prop
Batch Operations
Reactive selection state with dynamic button labels and conditional content
Batch Operations
Confirm actions on multiple items
items selected
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
signal |
str | Signal |
auto-generated |
Named signal for programmatic open/close. Creates a DOM ref accessible as $name in Datastar expressions |
cls |
str |
'' |
Additional CSS classes for the dialog element |
| Component | Description |
|---|---|
AlertDialog |
Root container that manages dialog open/close state |
AlertDialogTrigger |
Button that opens the dialog. Props: variant ('default' | 'destructive'), size, and all Button props are passed through |
AlertDialogContent |
Dialog content container rendered inside the native <dialog> element |
AlertDialogHeader |
Flex column layout for title and description |
AlertDialogTitle |
Dialog title — rendered as <h2> with aria-labelledby linkage |
AlertDialogDescription |
Dialog description — rendered as <p> with aria-describedby linkage |
AlertDialogFooter |
Footer layout — stacks vertically on mobile, horizontal on sm+ |
AlertDialogAction |
Confirm button. Props: action (Any) — signal setters or js() to run before close; variant ('default' | 'destructive') |
AlertDialogCancel |
Cancel button — always renders with variant='outline'. Closes the dialog with no additional action |