Skip to Content
Sponsor

usePrefersReducedMotion

usePrefersReducedMotion is a custom hook used to help detect the users motion preference.

Learn more about the API and its backgrounds.

Import#

Return value#

The usePrefersReducedMotion hook returns a boolean, indicating whether the user prefers reduced motion.

Keep in mind this API relies on the users browser support of window.matchMedia and will always return false if it is not supported or does not exist (e.g. during serverside rendering).

Usage#

Edit this page