responsive-query
v1.0.0-alpha.8
Published
Query on the current mode of the screen for js
Downloads
3
Maintainers
Readme
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},