Skip to content

isTouchDevice ​

The isTouchDevice function checks if the device supports touch events.

Syntax ​

typescript
isTouchDevice(): boolean;

Parameters ​

NameTypeDescription
––This function does not take any parameters

Returns ​

NameTypeDescription
–booleantrue if the device is touch

Examples ​

typescript
isTouchDevice();
// => true

Notes ​

  • Useful for adapting interfaces for mobile or hybrid devices.

References ​

Released under the MIT License.