Platform detection
A set of constant booleans (not functions) that describe the current platform. Each is computed once when the module is first imported and is SSR-safe — on the server every flag is false.
import { isMac, isWindows } from "vueless";
const shortcutLabel = isMac ? "⌘ + K" : "Ctrl + K";These are boolean values, so use them directly (if (isMac)). Do not call them — isMac() will throw.
Flag
true when…
isMac
The platform is macOS. May also be true on iPadOS 13+ iPads (they report "Mac").
isWindows
The platform is Windows.
isIOS
The device is an iPhone, iPad, or iPod (incl. iPadOS iPads reporting as "Mac").
isAndroid
The platform is Android.
isPWA
The app runs as an installed standalone web app (iOS-standalone signal).
isMobileApp
Aggregate of `isPWA
import { isMobileApp, isIOS } from "vueless";
if (isMobileApp) enableTouchGestures();
if (isIOS) applyIOSScrollFix();Last updated