Platforms

Three idioms from one stylesheet. iOS 26 is the default; wrapping any subtree in a PlatformProvider — or flipping the switch in the toolbar — sets data-platform, and tokens.css swaps the colours, type scale, corners and every control metric at runtime. Components change structure only where Apple’s do.

Side by side

The same components under each platform.

iOS 26

Liquid Glass. Capsule buttons, the 63 × 28 switch with its oval knob, 26 pt grouped lists, 34 pt alerts, floating glass bars.

Large Title

Body text at the platform’s default size.

macOS 26

Tahoe. 24 pt controls with 6 pt corners (capsules from the large size), 16 pt checkboxes, 13 pt body, AppKit’s 85 % label.

Large Title

Body text at the platform’s default size.

Web

apple.com and Apple’s web apps. 980 px pill buttons, 17/25 body with SF Pro tracking, #1d1d1f on white, #0071e3 buttons, #06c links.

Large Title

Body text at the platform’s default size.

What changes

Everything below is CSS. The platform is stamped on the document root so portaled overlays inherit it too.

iOS 26macOS 26Web
Body text17/2213/1617/25, −0.022em
Regular button34, capsule24, r 636, pill
Switch63 × 28, oval knob54 × 24, oval knob51 × 31
Checkbox22 circle16 square r 416 square r 4
List row / corner52 / 2628 / 1044 / 12
Alert320, r 34, capsule actions260, r 16320, r 12
Label colourblackblack 85 %#1d1d1f
Tintsystem blueaccent #007aff#0071e3

Picking a platform

Set it explicitly, or let detectPlatform() read the visitor’s device: iOS and iPadOS get ios, macOS gets macos, everything else web.

import { PlatformProvider } from "@applecn/ui/lib/platform"
import { detectPlatform } from "@applecn/ui/lib/detect-platform"

<PlatformProvider platform={detectPlatform()}>
  <App />
</PlatformProvider>