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(): booleanReturns
boolean
Related
useDebouncedValue · useFocusTrap · useIsMobile · useModalLock
Source
src/hooks/useReducedMotion.ts (line 7) on GitHub.