IsMac

A hook to determine if the user is on a Mac.

Windows (sorry Linux users)

Installation

jsrepo add hooks/is-mac.svelte

Usage

Keys

Often times you'll want to show modifier keys in your UI. You can do this with the exported cmdOrCtrl and optionOrAlt variables.

Command/Ctrl Ctrl
Option/Alt Alt

Acknowledgements

This hook is based on the shadcn-svelte useIsMac hook, as well as some useful enhancements by Thomas G. Lopes