Loading...
Please waitLoading...
Please waitTrack the user's prefers-reduced-motion setting so animation-heavy UI can adapt to accessibility preferences.
pnpm dlx uselab@latest add use-reduced-motion
import { useReducedMotion } from "@/hooks/use-reduced-motion"
export function MotionAwareCard() {
const prefersReducedMotion = useReducedMotion()
return (
<div
className={
prefersReducedMotion ? "" : "transition-transform hover:-translate-y-1"
}
>
Content
</div>
)
}useReducedMotion()| Name | Type | Description |
|---|---|---|
| return value | boolean | true when the user prefers reduced motion. |
Use this signal to disable autoplay motion, shorten transitions, or switch to instant state changes for comfort-sensitive users.
Preview card
The hover lift stays still when reduced motion is enabled.