react-hook-media-query

    1.0.4 • Public • Published

    react-hook-media-query 📐

    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

    Install

    npm i react-hook-media-query

    DownloadsWeekly Downloads

    82

    Version

    1.0.4

    License

    LGPL

    Unpacked Size

    10.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • bence.a.toth