https://github.com/oscarcornejo/use-viewport-size
A tiny React hook which allows you to track visible window viewport size in your components
https://github.com/oscarcornejo/use-viewport-size
Last synced: 2 months ago
JSON representation
A tiny React hook which allows you to track visible window viewport size in your components
- Host: GitHub
- URL: https://github.com/oscarcornejo/use-viewport-size
- Owner: oscarcornejo
- License: mit
- Created: 2022-05-21T03:02:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-21T04:44:21.000Z (about 3 years ago)
- Last Synced: 2025-02-14T23:19:59.471Z (4 months ago)
- Language: TypeScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# use-viewport-sizes


A tiny React hook which allows you to track visible window viewport size in your components.
## Installation
```
npm install @austral-ui/use-viewport-size
```## Usage
### **See it in Action**
```
import React from 'react';
import { useViewportSize } from '@austral-ui/use-viewport-size';export function App() {
const { width, height } = useViewportSize();return (
Viewport Size
{width}px / {height}px
);
}export default App;
```## Support
If you have read the examples and have any issues which you know are glitches, or would like to request something changed, please feel free to [post an issue on Github](https://github.com/oscarcornejo/use-viewport-size/issues/new).
Otherwise, if this was useful and you'd like to show your support, no donations necessary, but please consider [checking out the repo](https://github.com/oscarcornejo/use-viewport-size) and giving it a star (⭐).
## License
- Open Source **[MIT license](http://opensource.org/licenses/mit-license.php)**