A window overlaid on the primary content. Plays open and close sounds.
A window overlaid on the primary content. The sensory-ui Dialog plays sounds when opening and closing, signaling the modal transition.
Pattern: Open / close
npx shadcn@latest add SatyamVyas04/sensory-ui/sensory-ui-dialogimport {
Dialog,
DialogClose,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogOverlay,
DialogPortal,
DialogTitle,
DialogTrigger,
} from "@/components/ui/sensory-ui/dialog";| Prop | Type | Default | Description |
|---|---|---|---|
sound | SoundRole | false | "overlay.open" | Sound played when the dialog opens. |
closeSound | SoundRole | false | "overlay.close" | Sound played when the dialog closes. |
volume | number | 1 | Per-component volume multiplier (0–1). |
overlay.open on open, overlay.close on close.
<Dialog>
<DialogTrigger>Open</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Edit profile</DialogTitle>
<DialogDescription>
Make changes to your profile here.
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog><Dialog sound="notification.info" closeSound="interaction.subtle">
{/* ... */}
</Dialog><Dialog sound={false} closeSound={false}>
{/* ... */}
</Dialog><Dialog sound="overlay.open" closeSound="overlay.close">
<DialogTrigger>Edit profile</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Edit profile</DialogTitle>
</DialogHeader>
{/* Form fields */}
</DialogContent>
</Dialog><Dialog sound="notification.warning" closeSound="overlay.close">
<DialogTrigger>Delete item</DialogTrigger>
<DialogContent>
{/* Warning content */}
</DialogContent>
</Dialog>| Prop | Value |
|---|---|
sound | "overlay.open" |
closeSound | "overlay.close" |
volume | 1 |
| Situation | Recommended Sound | Why |
|---|---|---|
| Form dialog | overlay.open / overlay.close | Default: clear modal cue |
| Confirmation | notification.warning | Warns of important decision |
| Info modal | notification.info | Neutral, informative |
| Image lightbox | overlay.open / overlay.close | Content focus |
| Silent modal | false | For auto-opening dialogs |
| Event | Default Sound |
|---|---|
| Dialog opens | overlay.open |
| Dialog closes | overlay.close |
View the original Dialog documentation.