Skip to Content
BBRICKSv0.7.4
DataInterface hooks

useReducedMotion

Custom hook to detect whether the user has requested reduced motion via OS accessibility settings (prefers-reduced-motion: reduce).

import { useReducedMotion } from '@ergasti/bricks';

Examples

Respect reduced motion

True when the visitor's system asks for less motion; the library's own transitions already check it. Turn it on in your OS settings to see this change.

Code
import { useReducedMotion } from '@ergasti/bricks';

function Motion() {
  const reduced = useReducedMotion();
  return <p>Reduced motion: <b>{String(reduced)}</b></p>;
}

Signature

function useReducedMotion(): boolean

Returns

boolean

useDebouncedValue · useFocusTrap · useIsMobile · useModalLock

Source

src/hooks/useReducedMotion.ts (line 7) on GitHub.

On this page