A compact action menu whose items arrive in a 30 ms cascade.
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/dropdown-menu.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/dropdown-menu.json
Turn on the motion
npx @prequelui/cli@latest animate dropdown-menuThe 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 {
DropdownMenu,
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
} from "@/components/prequelui/dropdown-menu";
export default function Demo() {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button type="button">Actions</button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
<DropdownMenuItem onSelect={() => console.log("duplicate")}>
Duplicate
</DropdownMenuItem>
<DropdownMenuItem onSelect={() => console.log("rename")}>
Rename
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem onSelect={() => console.log("archive")}>
Archive
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}import { DropdownMenu } from "@/components/prequelui/dropdown-menu";
export function Variant() {
return (
<DropdownMenu tempo={1.2}>
…
</DropdownMenu>
);
}Animation
The surface grows from 90% in 220 ms while its rows arrive one after another from four pixels above. Closing is quicker and does not stagger, so a dismissed menu gets out of the way immediately.
- Surface: 220 ms on the soft curve from scale 0.9 and a 2 px blur.
- Rows: 180 ms each, 30 ms apart, from y -4.
- Closing: 150 ms for the whole surface, no per-row delay.
- Outside pointerdown and Escape both dismiss the menu.
- Reduced motion keeps the fade and drops the scale.
API Reference
Every part takes exactly the props of the Dropdown Menu primitive. The animated surface adds only motion props, so the accessibility tree and keyboard behaviour stay the same.