3.0.0 ā¢ Published 3 years ago
use-reduced-motion v3.0.0
React hook to detect user reduced motion feature
Install
npm install use-reduced-motion
yarn add use-reduced-motion
Usage
Use directly in your component. Pass the boolean value to your JS animated component to stop it.
import React from "react";
import { useReducedMotion } from "use-reduced-motion";
import { AnimatedDiv } from "../somewhere";
export const MyExampleComponent = () => {
const stopMotion = useReducedMotion();
return <AnimatedDiv pause={stopMotion} />;
};
Author
š¤ Antoine CARON antoine395.caron@gmail.com
- Website: http://slashgear.github.io/
- Twitter: @Slashgear_
- Github: @Slashgear
Show your support
Give a āļø if this project helped you!
š License
Copyright Ā© 2020 Antoine CARON <antoine395.caron@gmail.com>. This project is MIT licensed.
This README was generated with ā¤ļø by readme-md-generator