Overlays
Alert Dialog
A modal that interrupts to confirm a consequential action, with danger, warning and info variants.
Group: Overlays. Exports: AlertDialog. shadcn/ui equivalent: Alert Dialog (matches).
Usage
import { AlertDialog } from "./halaska-kit";
AlertDialog props
openboolean: Whether the overlay is shown.onClose() => void: Called when the overlay should close.titlestring: Heading text.descriptionstring: Supporting text.variantstring(default "danger"): Visual variant.confirmLabelstring(default "Confirm"):cancelLabelstring(default "Cancel"):onConfirmfunction:
Accessibility
- Has the alertdialog role with aria-modal, and a string title becomes its accessible name.
- Focus moves inside on open, Tab stays inside, and focus returns to the opener on close.
- Escape and a scrim click both cancel.
- The description is not linked with aria-describedby, and page scroll is not locked.
Halaska UI · Components · Patterns · Screens · Install