# useApplePlatform (/docs/hooks/use-apple-platform)





`useApplePlatform` tells you whether the visitor is on macOS, iOS or iPadOS. It is the same check [`useHotkey`](/docs/hooks/use-hotkey) runs to decide that `mod` means ⌘ there and Ctrl everywhere else, so a hint you label with it always matches the key that actually fires.

```tsx
import { useApplePlatform } from '@42-central/ui-react';

const apple = useApplePlatform();
<Kbd>{apple ? '⌘' : 'Ctrl'}</Kbd>
```

To label a whole hotkey string, you don't need it directly: `<Kbd hotkey="mod+k" />` draws `[⌘] [K]` or `[Ctrl] [K]` for you, one cap per key, and [`hotkeyKeys` and `formatHotkey`](/docs/hooks/use-hotkey#labels) (pass them this hook's value while rendering) give you the same keys as text.

## Usage [#usage]

<Preview code="&#x22;const apple = useApplePlatform();\n\n<Kbd>{apple ? '⌘' : 'Ctrl'}</Kbd>\n<Kbd>K</Kbd>&#x22;">
  <ApplePlatformDemo />
</Preview>

## API [#api]

```ts
function useApplePlatform(): boolean
function isApplePlatform(): boolean
```

`useApplePlatform` takes no arguments and returns `true` on an Apple platform.

`isApplePlatform` is the plain function underneath, for code outside render: an event handler, or a module that formats a shortcut string. It reads `navigator.userAgentData.platform` where the browser has it and falls back to `navigator.platform`, and returns `false` when there is no `navigator` (on the server).

## SSR [#ssr]

The hook returns `false` on the server and during the hydration render, then the real value right after. A Mac visitor therefore sees `Ctrl` for one frame on a server-rendered page. That frame is what keeps the server HTML and the hydrated markup identical. Calling `isApplePlatform()` directly during render would skip that step and cause a hydration mismatch on every Mac, so use the hook in components.
