@stackmeister/react-use-media-query-match
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

@stackmeister/react-use-media-query-match

Use reactive media queries directly inside React.

Great for reactive, responsive design and responsive DOM changes.

Install

// Yarn
yarn add @stackmeister/react-use-media-query-match

// NPM
npm i @stackmeister/react-use-media-query-match

TypeScript typings are included (No @types/ package needed)

Usage

import useMediaQueryMatch from '@stackmeister/react-use-media-query-match'

const App = () => {
  const matches = useMediaQueryMatch('all and (min-width: 1200px')

  return (
    <div ref={ref}>
      Hello {matches ? 'Desktop!' : 'Mobile!'}!
    </div>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @stackmeister/react-use-media-query-match

Weekly Downloads

0

Version

0.1.5

License

MIT

Unpacked Size

6.82 kB

Total Files

7

Last publish

Collaborators

  • torbenkoehn