Playground

useReducedMotion

Whether the user has asked the system to reduce motion, for skipping or simplifying animation in code.

  • 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

Motion preference

Set “reduce motion” in your system settings to see it change.

Behaviour

  • No DOM output. CSS already disables animation under prefers-reduced-motion; use this for JS-driven motion.