Keyframery

Animated Menu for UI SDK

The sheet unfolds from its button, rows cascade in and one highlight glides between items.

Part of Keyframery, the open-source animated components for UI SDK

The demo plays by itself. Point at it or press Tab to take over.

Installation

npx shadcn@latest add @keyframery/menu

This adds components/keyframery/menu.tsx and its primitive, components/keyframery/primitives/menu.tsx, to your project, and installs @ui-sdk/react. The motion tokens are added to your global CSS the first time you install a component.

Usage

import {
  Menu,
  MenuCheckboxItem,
  MenuContent,
  MenuContextTrigger,
  MenuGroup,
  MenuGroupLabel,
  MenuItem,
  MenuItemIcon,
  MenuItemIndicator,
  MenuItems,
  MenuRadioGroup,
  MenuRadioItem,
  MenuSeparator,
  MenuShortcut,
  MenuSub,
  MenuSubContent,
  MenuSubTrigger,
  MenuTrigger,
} from "@/components/keyframery/menu"

The parts and props are the same as UI SDK's Menu. For every prop, see the UI SDK menu reference.

What moves

MoveWhat you see
UnfoldThe sheet unfolds from the button that opened it.
CascadeRows arrive one after another.
GlideOne highlight glides between items.
DrawChecks draw themselves; submenus unfold sideways.

Timing and springiness follow the motion style you set, so this component moves like the rest of your app.

Swap the import

Already using UI SDK's menu with your own styles? Keep your markup and change one line. The primitive adds motion and nothing else.

// Before
import { … } from "@ui-sdk/react/menu"

// After: same parts, same props, now animated
import { … } from "@/components/keyframery/primitives/menu"

Parts

The finished component exports 18 parts:

Menu, MenuCheckboxItem, MenuContent, MenuContextTrigger, MenuGroup, MenuGroupLabel, MenuItem, MenuItemIcon, MenuItemIndicator, MenuItems, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger

Accessibility

Keyboard, focus and screen-reader behaviour come from UI SDK and are not changed. With reduced motion turned on, nothing in the menu moves: changes happen at once or with a short fade. More in Accessibility.

Source

The code that lands in your project. It is yours to change.

Questions

How does the animated Menu for UI SDK move?

Unfold: The sheet unfolds from the button that opened it. Cascade: Rows arrive one after another. Glide: One highlight glides between items. Draw: Checks draw themselves; submenus unfold sideways.

Do I need Motion or Framer Motion for the animated Menu?

No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.

Can I keep my own styling and only take the motion?

Yes. Import from @/components/keyframery/primitives/menu instead. It has the same parts and props as @ui-sdk/react/menu and adds motion only.

What happens to the Menu when someone turns on reduced motion?

Nothing moves. State changes happen at once, or with a short fade.

On this page