A modal that tips into view from its edge while the page blurs behind it.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/dialog.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/dialog.json
Turn on the motion
npx @prequelui/cli@latest animate dialogThe CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.
Usage
Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.
import {
Dialog,
DialogTrigger,
DialogContent,
DialogTitle,
DialogDescription,
DialogFooter,
DialogClose,
} from "@/components/prequelui/dialog";
import { Button } from "@/components/ui/button";
export default function Demo() {
return (
<Dialog>
<DialogTrigger asChild>
<Button>Open dialog</Button>
</DialogTrigger>
<DialogContent side="top">
<DialogTitle>Invite a teammate</DialogTitle>
<DialogDescription>
They will receive an email with a link to join this workspace.
</DialogDescription>
<DialogFooter>
<DialogClose asChild>
<Button variant="ghost">Cancel</Button>
</DialogClose>
<Button>Send invite</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}import { Dialog } from "@/components/prequelui/dialog";
export function Variant() {
return (
<Dialog tempo={1.2}>
…
</Dialog>
);
}Animation
The popup behaves like a card standing on the page: it tips from the edge it belongs to while the veil both tints and blurs the page behind it. The veil animates colour and filter together, never opacity alone.
- Popup spring: stiffness 150, damping 25.
- Entry: perspective 500 px, 20° tilt, scale 0.8, 4 px blur.
- Exit: 200 ms away-ease, faster than the entrance and without the tilt.
- Reopening mid-close starts from the current colour and blur.
- Reduced motion removes the 3D tilt and the blur, keeping the fade.
API Reference
Every part takes exactly the props of the Dialog primitive. The animated surface adds only motion props, so the accessibility tree and keyboard behaviour stay the same.
Dialog
| Prop | Type | Default |
|---|---|---|
| open | boolean | — |
| defaultOpen | boolean | false |
| onOpenChange | (open: boolean) => void | — |
| modal | boolean | true |
| side | "top" | "bottom" | "left" | "right" | "top" |
DialogContent
| Prop | Type | Default |
|---|---|---|
| side | "top" | "bottom" | "left" | "right" | inherited |
| showClose | boolean | true |
| hideOverlay | boolean | false |
| transition | Transition | component spring or tween |
| exitTransition | Transition | 200 ms, away ease |
| className | string | — |
DialogTrigger / DialogClose
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
| className | string | — |