useReducedMotion
Whether the user has asked the system to reduce motion, for skipping or simplifying animation in code.
Source@monoline/react 0.5.0Markdown for AI toolsstable
- No DOM output. CSS already disables animation under prefers-reduced-motion; use this for JS-driven motion.
Import
import '@monoline/css';
import {useReducedMotion} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add use-reduced-motion
Usage
import {useReducedMotion} from '@monoline/react';
function MotionDemo() {
const reduce = useReducedMotion();
return <p>{reduce ? 'You asked for less motion: transitions are skipped.' : 'Motion is allowed.'}</p>;
}
<MotionDemo />
Examples
Behaviour
- No DOM output. CSS already disables animation under prefers-reduced-motion; use this for JS-driven motion.