mazey
    Preparing search index...

    Function isPhone

    • Check whether a user agent represents a mobile phone or handset-class device. Tablet devices are classified separately by isTablet.

      The classifier recognizes iPhone and iPod user agents, Android user agents that contain the Mobile token, and a bounded Mobile token as a fallback for otherwise unknown clients. Stronger tablet signals take priority.

      Parameters

      • OptionaluserAgent: string

        Optional user-agent string. Defaults to the current browser's guarded navigator signals. An explicit string is classified by itself without current platform or touch information.

      Returns boolean

      true for a recognized phone or handset-class device; otherwise false. Returns false during SSR when no explicit user agent is available.

      If an explicitly supplied user agent is not a string.

      Device classification is heuristic and spoofable. Do not use this helper as a security boundary or as a substitute for responsive CSS or feature detection. It does not inspect viewport dimensions. The separate isMobile export is an alias of the isValidPhoneNumber string validator.