UseOs

use-os detects users 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.

Usage

Code Editor
Copy
import { useOs } from '@erudilabs/alma'

const os = useOs()

Your are currently using OS undetermined

Code Editor
Copy
<p>Your are currently using OS <b>{os}</b></p>

Types

Code Editor
Copy
import type { OSProps } from '@erudilabs/alma'

OSProps = 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux'