Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Other System APIs

Additional platform-level APIs.

Open URL

Open a URL in the default browser or application:

import { openURL } from "perry/system";

openURL("https://example.com");
openURL("mailto:user@example.com");
PlatformImplementation
macOSNSWorkspace.open
iOSUIApplication.open
AndroidIntent.ACTION_VIEW
WindowsShellExecuteW
Linuxxdg-open
Webwindow.open

Dark Mode Detection

import { isDarkMode } from "perry/system";

if (isDarkMode()) {
  // Use dark theme colors
}
PlatformDetection
macOSNSApp.effectiveAppearance
iOSUITraitCollection
AndroidConfiguration.uiMode
WindowsRegistry (AppsUseLightTheme)
LinuxGTK settings
Webprefers-color-scheme media query

Clipboard

import { clipboardGet, clipboardSet } from "perry/system";

clipboardSet("Copied text!");
const text = clipboardGet();

Next Steps