Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 791 Bytes

use-os.mdx

File metadata and controls

36 lines (26 loc) · 791 Bytes

import { HooksDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';

export default Layout(MDX_DATA.useOs);

Usage

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

OS type

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

import type { OS } from '@mantine/hooks';

// OS type is 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux'

Definition

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