import { HooksDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';
export default Layout(MDX_DATA.useOs);
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.
You can import OS
union type from @mantine/hooks
:
import type { OS } from '@mantine/hooks';
// OS type is 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux'
function getOS(options?: {
getValueInEffect: boolean;
}):
| 'undetermined'
| 'macos'
| 'ios'
| 'windows'
| 'android'
| 'linux';