Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

usePrefersReducedMotion

Whether the reader asked to reduce motion.

HooksA11y@gaudi/design-system/hooks/a11y/use-prefers-reduced-motionView in StorybookSource

True when the operating system reduce-motion setting is on, updated live. Built on useMediaQuery.

Usage

import { usePrefersReducedMotion } from '@gaudi/design-system/hooks';
const reduced = usePrefersReducedMotion();
window.scrollTo({ top: 0, behavior: reduced ? 'auto' : 'smooth' });

Examples

Read the preference

Storybook

Turn autoplay off

Storybook

API

1 option
1 return value

Accessibility

When set, skip autoplay, parallax, typing effects and smooth scrolling, or replace them with an instant change. global.css already shortens CSS transitions; use this hook for motion driven from JavaScript.

Notes

  • REDUCED_MOTION_QUERY is exported for CSS-in-JS or imperative checks.