Tweakr
    Preparing search index...

    Function getDeviceType

    • Detects the current device type based on the window width.

      Returns "mobile" | "tablet" | "desktop"

      "mobile" | "tablet" | "desktop" depending on window width.

      const device = getDeviceType();
      console.log(device); // "mobile", "tablet", or "desktop"

      1.1.0