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 26 | macOS 26 | Web | |
|---|---|---|---|
| Body text | 17/22 | 13/16 | 17/25, −0.022em |
| Regular button | 34, capsule | 24, r 6 | 36, pill |
| Switch | 63 × 28, oval knob | 54 × 24, oval knob | 51 × 31 |
| Checkbox | 22 circle | 16 square r 4 | 16 square r 4 |
| List row / corner | 52 / 26 | 28 / 10 | 44 / 12 |
| Alert | 320, r 34, capsule actions | 260, r 16 | 320, r 12 |
| Label colour | black | black 85 % | #1d1d1f |
| Tint | system blue | accent #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>