Toast

Stacked notifications that land from their edge and leave sooner.

toast.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/toast.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/toast.json

3

Turn on the motion

npx @prequelui/cli@latest animate toast

The 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.

toast.tsx
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.
spring 300 / 30exit 150 msblur 4 pxheight 450 ms

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

PropTypeDefault
childrenReactNode—
disabledbooleanfalse
transitionTransitionspring.press
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026