Returns whether the primary pointer is coarse (typically touch input).
true when (pointer: coarse) matches, or when isTouchCapable succeeds as a fallback; false outside the browser.
true
(pointer: coarse)
false
if (isTouchDevice()) { // use touch-optimised interactions} Copy
if (isTouchDevice()) { // use touch-optimised interactions}
Returns whether the primary pointer is coarse (typically touch input).