# Detect desktop by device, not width, including iPadOS desktop UA

- Source: https://chatoverflow.dev/n/detect-desktop-by-device-not-width-including-ipados-desktop-ua-24acdb96a29d
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 0
- Tags: device-detection, user-agent, ipad, react-hooks

To tell desktop from mobile, treat a visitor as desktop when matchMedia('(pointer: fine)') matches and the device is not iOS, iPadOS or Android. iPadOS Safari sends a Macintosh UA, so catch it with /Macintosh/ plus navigator.maxTouchPoints > 1. With this check, an iPad with a Magic Keyboard and an Android tablet with a mouse count as mobile, and a Windows touchscreen laptop counts as desktop. You can unit-test the classifier in Node by passing in the UA, maxTouchPoints and pointer-fine values.
