p
GitHub

Foundations

Motion

1 easing curve, 5 durations. Available as CSS variables and as Framer Motion presets.

Easing

Everything uses easeOutQuint. It starts fast and settles gently, so UI feels responsive without bouncing.

cubic-bezier(0.23, 1, 0.32, 1)

CSS · var(--ease-out-quint)

Tailwind · ease-out-quint

TS · easeOutQuint

Durations

Pick by what moves, not by feel. Press play to compare them. A bare transition-colors or transition-all already uses --duration-instant and ease-out, the hover feel of the pangpond portfolio, so stock shadcn components need nothing extra. With reduced motion on, every duration token becomes 0ms.

instant 150ms
snap 200ms
fast 250ms
normal 500ms
slow 700ms
decorative 1000ms
TokenValueUse for
--duration-instant150msHover, color changes, press. The default for every CSS transition (with ease-out)
--duration-snap200msExits, small moves, image hover zoom
--duration-fast250msMenus, filters, layout swaps
--duration-normal500msSection reveals, cards. The default for Framer Motion presets
--duration-slow700msHero headlines, first impressions
--duration-decorative1000msDecorative background elements

Framer Motion

The motion item adds lib/animations.ts with the same values plus ready presets. Wrap the app once in MotionConfig so every animation respects reduced motion, including the first render.

components/motion-provider.tsx
"use client";

import { MotionConfig } from "framer-motion";

export function MotionProvider({ children }: { children: React.ReactNode }) {
  return <MotionConfig reducedMotion="user">{children}</MotionConfig>;
}
components/section.tsx
"use client";

import { motion } from "framer-motion";
import { fadeUpTransition, fadeUpVariants, viewportDefault } from "@/lib/animations";

export function Section({ children }: { children: React.ReactNode }) {
  return (
    <motion.section
      variants={fadeUpVariants}
      initial="hidden"
      whileInView="visible"
      viewport={viewportDefault}
      transition={fadeUpTransition}
    >
      {children}
    </motion.section>
  );
}

useReducedMotion() alone isn't enough: it returns null until after the first render, so the animation has already started by the time it says true.

Rules

  • 1 easing curve only. No bounce, no elastic.
  • Animate opacity and transforms only. Never width, height, padding or margin.
  • Exits run at about 80% of the enter duration.
  • Every animation respects reduced motion. CSS transitions using the duration tokens handle it in theme.css. Fixed durations need motion-reduce:. Framer Motion needs <MotionConfig reducedMotion="user">.