shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
isMobile
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.is
Detect if is a mobile device (phone or tablet) Here’s the checklist we use:
- has touch events
- has orientation
- max width 639px (to be improved)
- pointer is coarse
Return
- -Boolean
true if is a mobile, false if not
Example
import { isMobile } from '@blackbyte/sugar/is'
if (isMobile()) {
// do something cool...
}Todo
- integrate some kind of media query checknormal
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space