Overlays
Dialog
A modal window over the page. Dialog holds plain content, FormDialog wraps fields in a form, CardDialog adds a cover and custom actions.
Group: Overlays. Exports: Dialog, FormDialog, CardDialog. shadcn/ui equivalent: Dialog (partial parity).
Usage
import { Dialog } from "./halaska-kit";
Dialog props
openboolean: Whether the overlay is shown.onClose() => void: Called when the overlay should close.titlestring: Heading text.childrenReactNode: Content.
FormDialog props
openboolean: Whether the overlay is shown.onClose() => void: Called when the overlay should close.titlestring: Heading text.descriptionstring: Supporting text.childrenReactNode: Content.submitLabelstring(default "Save"):onSubmitfunction:
CardDialog props
openboolean: Whether the overlay is shown.onClose() => void: Called when the overlay should close.coverReactNode:titlestring: Heading text.descriptionstring: Supporting text.childrenReactNode: Content.actionsReactNode:
Accessibility
- Every variant has the dialog 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 close. FormDialog submits on Enter from any field, because its body is a native form.
- Page scroll is not locked while a dialog is open.
Known gaps
- No composable parts (header, footer, close button). Each variant has a fixed layout.
- Dialog always renders Cancel and Confirm, and both only call onClose.
- No close button in the corner.
- Does not lock page scroll.
Halaska UI · Components · Patterns · Screens · Install