Skip to content

Motion provider

LazyMotion in strict mode with domMax loaded async. Wrap the app in it: every animated component imports m from motion/react-m.

Mount it once around the app, in the root layout. Under it, animate with m from motion/react-m and take springs from @khaeli/motion-tokens. It follows the reader's reduced-motion setting: movement and layout changes land at once, fades still play.

A child animating

Installation

npx shadcn@latest add @khaeli/motion-provider

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

npm packages
  • motion ^12.23.12

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/motion-provider.json