Dropdown Menu

A compact action menu whose items arrive in a 30 ms cascade.

dropdown-menu.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/dropdown-menu.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/dropdown-menu.json

3

Turn on the motion

npx @prequelui/cli@latest animate dropdown-menu

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.

dropdown-menu.tsx
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.
surface 220 msscale 0.9stagger 30 msclose 150 ms

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.

DropdownMenu

PropTypeDefault
openboolean—
defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
align"start" | "center" | "end""start"
sideOffsetnumber8

DropdownMenuItem

PropTypeDefault
onSelect() => void—
insetbooleanfalse
disabledbooleanfalse
classNamestring—

DropdownMenuContent

PropTypeDefault
align"start" | "center" | "end"inherited
sideOffsetnumberinherited
transitionTransitioncomponent spring or tween
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026