react-device-orientation-hook
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-device-orientation-hook

License: MIT

Demo

Usage

📌 Device Orientation Event works only in HTTPS for security reasons.

npm i react-device-orientation-hook
import useDeviceOrientation from 'react-device-orientation-hook;

function Component() {
  const { transformStyle, resetPivotOrientation } = useDeviceOrientation();

  return (
    <>
      <div style={transformStyle} onClick={resetPivotOrientation} >
        Hello World!
      </div>
      <p>Touch text and Revise orientation</p>
    </>
  );
}

Device Orientation Web API Spec

Development

Testing

npm run test

Building

npm run build

Storybook

To run a live-reload Storybook server on your local machine:

npm run storybook

Package Sidebar

Install

npm i react-device-orientation-hook

Weekly Downloads

31

Version

1.0.1

License

MIT

Unpacked Size

60.8 kB

Total Files

13

Last publish

Collaborators

  • doong-jo