Docs
/
devices

Devices

Client-side detections user's machines.

isServerSide

Link Copied!

Check if you're a server-side user.

Is Server Side 👍
Result
isServerSide()

detectUserDevice

Link Copied!

Detects the user's device based on the user agent string and returns the information as an object.

Result
detectUserDevice(userAgent?: string)

addDeviceClasses

Link Copied!

Adds detected devices as classes to your project's body class

Result
addDeviceClasses(userAgent?: string)

detectDevice

Link Copied!

Detect the current device type (Mobile or Desktop)

detectDevice(userAgent?: string)

detectBrowser

Link Copied!

Detect the current browser

detectBrowser(userAgent?: string)

detectOS

Link Copied!

Detect the current operating system

detectOS(userAgent?: string)

isIos

Link Copied!

Check if you're a passionate iPhone fan.

Not iOS 👎
Result
isIos(userAgent?: string)

isAndroid

Link Copied!

Check if you're a zealous Android fan.

Not Android 👎
Result
isAndroid(userAgent?: string)

isMac

Link Copied!

Check if you're a staunch Mac fan.

Not Mac 👎
Result
isMac(userAgent?: string)

isWindows

Link Copied!

Check if you're a fervent Windows fan.

Not Windows 👎
Result
isWindows(userAgent?: string)

isLinux

Link Copied!

Check if you're a devoted Linux fan.

Not Linux 👎
Result
Fun fact, most Linux users will tell you they have Linux before the function does.
isLinux(userAgent?: string)

isChrome

Link Copied!

Check if you're a die-hard Chrome fan.

Not Chrome 👎
Result
isChrome(userAgent?: string)

isFirefox

Link Copied!

Check if you're a dedicated Firefox fan.

Not Firefox 👎
Result
isFirefox(userAgent?: string)

isSafari

Link Copied!

Check if you're a lonely Safari fan.

Not Safari 👎
Result
isSafari(userAgent?: string)

isEdge

Link Copied!

Check if you're an ardent Edge fan.

Not Edge 👎
Result
isEdge(userAgent?: string)

isMobile

Link Copied!

Check if you're rocking a mobile

Not Mobile 👎
Result
isMobile(userAgent?: string)

isTablet

Link Copied!

Check if you're tablet user

Not Tablet 👎
Result
isTablet(userAgent?: string)

isDesktop

Link Copied!

Check if you're pro desktop user

Not Desktop 👎
Result
isDesktop(userAgent?: string)

isPortrait

Link Copied!

Check if you're portrait

Not Portrait 👎
Result
isPortrait()

isLandscape

Link Copied!

Check if you're landscape

Not Landscape 👎
Result
isLandscape()

isBot

Link Copied!

Check if you're a cyborg or a bot

Not Bot 👎
Result
isBot(userAgent?: string)

isHuman

Link Copied!

Check if you're a human

Not Human 👎
Result
isHuman(userAgent?: string)

isDeveloper

Link Copied!

Check if you're a developer

Not Developer 👎
Result
isDeveloper()