@frontplus-ui/use-media-query
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

@frontplus-ui/use-media-query

Subscribe and respond to media query changes with useMediaQuery.

The useMediaQuery hook leverages the window.matchMedia API to subscribe to CSS media query changes, thereby providing real-time responsiveness to dynamic changes in the viewport or screen orientation. It allows the component to rerender whenever the media query’s result changes. It throws an error if attempted to be used on the server-side (media queries only work in the browser).

Installation

pnpm add @frontplus-ui/use-media-query
# or
yarn add @frontplus-ui/use-media-query
# or
npm i @frontplus-ui/use-media-query

API Reference

is in progress

Licence

This project is licensed under MIT license

Readme

Keywords

Package Sidebar

Install

npm i @frontplus-ui/use-media-query

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

5.84 kB

Total Files

7

Last publish

Collaborators

  • npm-support