Primitives
The foundation every component builds on: motion tokens, the provider and a few small hooks.
Motion tokens
Springs are named by role instead of by numbers, so the same kind of movement feels the same everywhere. Durations, easing curves, scales and blur amounts follow the same idea.
Install
npx shadcn@latest add @kinetic/motion-tokens| Role | Stiffness / damping / mass | Used for |
|---|---|---|
press | 520 / 34 / 0.8 | Button and tile press feedback |
pop | 420 / 26 / 0.85 | Badges, popovers and tooltips appearing |
selection | 460 / 36 / 0.9 | Tab indicators and selected state |
dialog | 340 / 30 / 1 | Dialogs, sheets and drawers |
gentle | 180 / 24 / 1.05 | Large layout moves |
snappy | 600 / 38 / 0.75 | Switches, checkboxes and small toggles |
bouncy | 380 / 18 / 0.9 | Playful emphasis, used sparingly |
KineticProvider
The provider holds three settings for everything below it. Each one can be controlled (tempo, accentPreset, reducedMotion) or left to an initial value (defaultTempo, defaultAccentPreset, defaultReducedMotion).
tempomultiplies every duration and scales springs while keeping their damping ratio, so a faster tempo never gets bouncier. It is clamped between 0.1 and 10.accentPresetis one ofmonochrome,emerald,indigo,amberorrose.reducedMotionis"user"(follow the device),"always","never"or a boolean.
app/layout.tsx
<KineticProvider
defaultTempo={1}
defaultAccentPreset="indigo"
defaultReducedMotion="user"
>
{children}
</KineticProvider>Using springs
Read a spring with getSpring(role) from useKinetic(). The transition it returns already follows the current tempo and reduced-motion setting.
components/badge.tsx
"use client";
import { motion } from "motion/react";
import { useKinetic } from "@/components/kinetic/kinetic-provider";
interface BadgeProps {
readonly children: React.ReactNode;
}
export function Badge({ children }: BadgeProps) {
const { getSpring } = useKinetic();
return (
<motion.span
initial={{ opacity: 0, scale: 0.94 }}
animate={{ opacity: 1, scale: 1 }}
transition={getSpring("pop")}
className="rounded-full bg-primary px-3 py-1 text-xs text-primary-foreground"
>
{children}
</motion.span>
);
}Hooks
| Hook | What it does |
|---|---|
useReducedMotionSafe | Reads reduced-motion and fine-pointer media queries without hydration mismatches. |
usePointerPosition | Tracks pointer position and velocity as motion values, with no re-renders. |
useThemeObserver | Reports the resolved light or dark theme and the active accent preset. |
useMagnetic | Adds a spring-damped magnetic pull, only on fine pointers and with motion allowed. |
Install a hook by its kebab-case name, for example use-magnetic. It is written to hooks/.
Install
npx shadcn@latest add @kinetic/use-magnetic