1.0.5 • Published 4 years ago

react-hook-media-query v1.0.5

Weekly downloads
133
License
LGPL
Repository
github
Last release
4 years ago

react-hook-media-query :triangular_ruler:

A React hook to match media queries.

Installation

Using npm:

npm install --save react-hook-media-query

Using yarn:

yarn add react-hook-media-query

Usage

import React from 'react'
import useMediaQuery from 'react-hook-media-query'

const ComponentWithMediaQuery = () => {
  const small = useMediaQuery('(max-width: 720px)')

  return (
    <p>Viewport width is {small ? 'below' : 'above'} 720.</p>
  )
}

Contributions

Contributions are welcome. File bug reports, create pull requests, feel free to reach out at tothab@gmail.com.

Licence

LGPL-3.0

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago