DocsCustomization
Motion
Every section works without animation. Where movement adds meaning, there is also a motion version with the same props, built on the motion package.
Plain and motion
The plain file is a server component with CSS only. The motion file, <name>-motion.tsx, is a client component that takes exactly the same props, so you can swap one for the other without touching your content. Section pages show both behind the Plain / Motion switch.
Install
Add -motion to the item name. The CLI also installs the plain version (the motion one reuses its parts) and the motion npm package.
import { HeroMotion } from "@/components/custom/hero/hero-motion";What motion versions promise
- Reduced motion. They call
useReducedMotion(); with the setting on, they render exactly the plain layout. - Content is never hidden. Text and images are in the server HTML and visible before JavaScript runs. Animation starts only after mount.
- A pause button. Anything that moves for more than five seconds, such as a marquee or a looping beam, has a visible pause control.
- Cheap properties. They animate transform, opacity, filter, clip-path and shadows only, so layout never shifts.
- One tree. The server and the browser render the same markup; motion switches on after hydration instead of swapping in a different component.
Using motion sections from a server page
Props passed from a server component to a client component must be serializable. Pass icons as elements, not as component references:
// Works
icon: <Zap aria-hidden="true" />
// Fails: a function can't cross to the client
icon: ZapThe rules come from the contributing guide, which every new section follows.