https://github.com/bsonntag/react-device-orientation
A react wrapper for device orientation events.
https://github.com/bsonntag/react-device-orientation
component device-orientation react
Last synced: about 1 year ago
JSON representation
A react wrapper for device orientation events.
- Host: GitHub
- URL: https://github.com/bsonntag/react-device-orientation
- Owner: bsonntag
- License: mit
- Created: 2018-06-25T20:54:50.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-10-19T17:18:28.000Z (over 2 years ago)
- Last Synced: 2025-03-25T05:51:16.667Z (about 1 year ago)
- Topics: component, device-orientation, react
- Language: JavaScript
- Size: 365 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-device-orientation
> A react wrapper for device orientation events.
## Installation
Using npm:
```sh
$ npm install --save react-device-orientation
```
Using yarn:
```sh
$ yarn add react-device-orientation
```
## Example
```js
import DeviceOrientation from 'react-device-orientation';
import React from 'react';
const App = () => (
{({ absolute, alpha, beta, gamma }) => (
{`Absolute: ${absolute}`}
{`Alpha: ${alpha}`}
{`Beta: ${beta}`}
{`Gamma: ${gamma}`}
)}
);
```
## Contributing
Please feel free to submit any issues or pull requests.
## License
MIT