use-os

Get user os

Usage

use-os detects user's os. Possible values are: undetermined, macos, ios, windows, android, linux. If os cannot be identified, for example, during server side rendering undetermined will be returned.

Your os is undetermined

TypeScript

You can import OS union type from @bigcomponents/hooks:

import type { OS } from "@bigcomponents/hooks";
// OS type is 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux'

Definition

function getOS(options?: {
  getValueInEffect: boolean;
}): "undetermined" | "macos" | "ios" | "windows" | "android" | "linux";