Skip to content

Motion Primitives Grid Notes

Composable, minimal React motion building blocks — animated groups, text effects, morphing dialogs, docks and carousels — built on Motion and Tailwind CSS.

Grid NotesVersion betaUI librariesChecked 2026-11-04
Setup & agent config

Install and prerequisites

What your agent should install or configure before writing code with this pack.
Terminal
npx shadcn@latest add "https://motion-primitives.com/c/text-effect.json"
Packages:motionlucide-react

Requires Tailwind CSS, motion, lucide-react and a cn utility in @/lib/utils. Items install via direct .json URLs.

Framework setup

Production-ready wiring for React 19, Next.js App Router and Tailwind CSS v4.

Word-by-word TextEffect with reduced-motion fallback

Animate by per="word" or per="line" (avoid per="char" on long headings) and keep the full text accessible.

components/animated-lead.tsx
"use client";

import { TextEffect } from "@/components/ui/text-effect";

export function AnimatedLead({ children }: { children: string }) {
  return (
    <TextEffect per="word" preset="fade-in-blur" className="text-lg text-muted-foreground">
      {children}
    </TextEffect>
  );
}

Gotchas for agents

Real-world traps — version mismatches, licence boundaries, main-thread stalls and CSS layer rules — that trip AI agents up.
  1. Install by full JSON URL

    Motion Primitives components are hosted at https://motion-primitives.com/c/<name>.json. Pass the full URL to npx shadcn@latest add unless you have configured a custom @motion-primitives entry in components.json.

  2. Beta API surface

    Because components are copied directly into your repo and the library is in beta, pin motion (14.x) and review prop types when adding new primitives that share internal helpers.

  3. MorphingPopover / MorphingDialog layoutId collisions

    Components that rely on Motion's shared layoutId will cross-animate across the page if rendered multiple times without a unique uniqueId or <LayoutGroup id={...}> wrapper.

Accessibility and reduced motion

How to keep animations and interactive components accessible across keyboard, screen readers and prefers-reduced-motion.

Reduced motion

Wrap primitives in <MotionConfig reducedMotion="user"> so preset="fade-in-blur" or slide variants drop their spatial movement under reduced motion.

Keyboard and screen readers

For MorphingDialog and Accordion, verify Escape closes modals, focus returns to the trigger on close, and aria-expanded / aria-controls attributes stay intact.