use-reduced-motion
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Welcome to use-reduced-motion 👋

Version Documentation Maintenance License: MIT Twitter: Slashgear_

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

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

Package Sidebar

Install

npm i use-reduced-motion

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

5.76 kB

Total Files

9

Last publish

Collaborators

  • slashgear