Stacked notifications that land from their edge and leave sooner.
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/toast.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/toast.json
Turn on the motion
npx @prequelui/cli@latest animate toastThe 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 { Toast } from "@/components/prequelui/toast";
export default function Demo() {
return (
<Toast>
{/* compose the parts exactly like the underlying primitive */}
</Toast>
);
}import { Toast } from "@/components/prequelui/toast";
export function Variant() {
return (
<Toast tempo={1.2}>
…
</Toast>
);
}Animation
Toasts land from the edge of the screen with a small scale and blur, then settle. The stack compresses the toasts behind instead of translating each one independently, so a new toast never pushes the whole column.
- Entry spring: 280 / 24 from translateY(100%), scale 0.96 and 4 px blur.
- Stack cascade: 30 ms inside a 150 ms window.
- Exit: 200 ms away-ease.
- The progress bar is linear and pauses while the window is unfocused.
API Reference
Every part takes exactly the props of the Toast primitive. The animated surface adds only motion props, so the accessibility tree and keyboard behaviour stay the same.
Toast
| Prop | Type | Default |
|---|---|---|
| children | ReactNode | — |
| disabled | boolean | false |
| transition | Transition | spring.press |
| className | string | — |