responsive-query
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.8 • Public • Published

responsive-query

Query on the current mode of the screen for js

  • Lightweight
  • Zero dependencies
  • Support typescript
  • Tested

Installation

npm i responsive-query

Easy to use

For example

import resQuery from "responsive-query" 


if (resQuery.is.Desktop) { // return true only if the screen between 1200-1800
    // do something
} 

if (resQuery.Desktop.andBigger) { // return true only if the screen bigger than 1200
    // do something
}

if (resQuery.Desktop.andSmaller) { // return true only if the screen smaller than 1800
    // do something
}

Screen types

Screen types divided to

  • BigDesktop: {from: 1800},
  • Desktop: {from:1200, to: 1800 },
  • TabletLandscape: {from:940 ,to: 1200},
  • TabletPortrait: {from:640 ,to: 940},
  • Smartphone: { to: 640},

Package Sidebar

Install

npm i responsive-query

Weekly Downloads

3

Version

1.0.0-alpha.8

License

MIT

Unpacked Size

14.5 kB

Total Files

19

Last publish

Collaborators

  • moshe_kabala