web-api-hooks
Version:
Essential set of React Hooks for convenient Web API consumption.
13 lines (12 loc) • 304 B
TypeScript
/**
* Tracks motion intensity preference of the user.
*
* @returns Preferred motion intensity.
*
* @example
* function Component() {
* const preferReducedMotion = useMotionPreference() === 'reduce';
* // ...
* }
*/
export default function useMotionPreference(): 'no-preference' | 'reduce';