This page as markdown: /ios-prototype.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt
Task: building an iOS app prototype
An iOS prototype is a clickable iPhone app that runs in the browser, for demos, presentations and user testing. It is not a native app and not for production.
The rule: Sable first
Every screen is built from Sable components, in the chosen preset. Rows, lists, inputs, switches, sliders, search, selects, buttons, forms, toasts, empty states, cards and all content are Sable — exactly as on the web.
The Sable iOS adapter (@sableui/react/ios) supplies only the iOS system
chrome Sable has no equivalent for:
| Chrome | Adapter |
|---|---|
| App frame, status bar, safe areas | NativeApp |
| A screen | IosPage |
| Navigation bar: title, large title, back, bar actions | IosNavbar, IosBackLink, IosIconButton |
| Tab bar | IosTabbar, IosTab |
| Sheet presentation (detents, drag, Escape) | IosSheet (its content is Sable) |
| Push and pop between screens | NavigationStack, useNavigation |
Never import from konsta. Konsta is the adapter's optional peer, not a
component library for the app; sable-lint flags a direct import
(native-ui-import). If a screen needs something Sable does not have, report
it as a library gap; do not reach for a native control or hand-build one.
sable target ios --component <Name> --json gives the decision for any
component: preserve (use the Sable component — almost everything),
replace (an adapter chrome component), contextual (Button and PageHeader:
the adapter only in the navigation bar, Sable everywhere else), recompose
(desktop patterns rebuilt from Sable parts for a phone, e.g. a table becomes
Entity rows in a Card) or redesign (desktop workspace tools).
How iOS screens look in Sable
- Grouped settings: a section heading (
text-title-sm text-muted-foreground) over aCardwithCardListandEntityrows; aSwitch, value text or chevron in each row'saction. - Forms:
FormwithFieldaroundInput,Textarea,Select,Slider. - Lists that drill down: interactive
Entityrows in aCardthat calluseNavigation().push(id, <NextScreen />). - Search:
SearchInputon the page margin. - Feedback:
toast()insideToastProvider;EmptyStatefor no results. - Align content to the native page margin with
px-(--ios-inset)so it lines up with large titles. The adapter spaces a screen's first content below its title.
Setup
Install
konstain the consuming project only when an iOS prototype is requested (pnpm add konsta). It is the adapter's optional peer.Give the prototype its own HTML entry, separate from the web app, with one stylesheet:
@import "tailwindcss"; @import "@sableui/react/styles.css"; @import "@sableui/react/theme/verdant.css"; /* the preset, or themes.css */ @import "@sableui/react/ios/styles.css"; @source "../node_modules/@sableui/react/dist";Set the preset with
data-sable-themeon<html>. The adapter maps the preset onto the chrome (background, ink, accent, fonts), so chrome and content follow the same preset and light or dark mode. It pins Tailwind's spacing and radii on the chrome only, so a preset's density and corners reach your Sable content and the chrome keeps iOS geometry.Compose:
NativeAppat the root (modesets light or dark, also on<html>so portaled Sable popups follow); oneNavigationStackper tab, each holding anIosPagewith anIosNavbarand Sable content; anIosTabbarofIosTabs with SableIcons;IosSheetaround Sable forms (background="opaque"for a form at the medium detent, and the blockframed={false}: the sheet is already its surface). Keep the app'sIconProvider.Frame it on a host page with
PhoneFramefrom@sableui/react/ios/previewand@sableui/react/ios/frame.css(Sable's Phone around an iframe at 402×874, scaled as a whole device).fit="contain"with a height inclassNamekeeps the whole device on screen. Shown on a real phone with no frame, passsystemChrome={false}toNativeApp: the device draws its own status bar and home indicator, and the safe areas come from it. To follow a host's live look, calluseIosPreviewBridge(frameRef, { mode })on the host anduseIosPreviewTheme()in the prototype.Verify light and dark, keyboard focus, reduced motion, back and edge swipe, independent tabs, sheet drag, Escape and cancel, form validation and save, and empty-state recovery. Run
sable-lintover the prototype: it is a Sable app and the same rules apply.
Geometry hooks
--ios-inset (16px page margin), --ios-safe-top (62px), --ios-header-height,
--ios-tabbar-bottom, --ios-content-bottom and --ios-motion, for the
standard 402×874 phone. Reduced transparency removes the glass blur.
The selected tab is a liquid lens, drawn by IosTabbar with nothing to wire.
Press or drag along the bar and it lifts and refracts the tabs under it;
releasing a drag selects the tab beneath, through that tab's own onClick.
It refracts in Safari and Firefox as well as Chromium. Reduced motion snaps it
into place; reduced transparency keeps it a flat pill.
Engineering handoff
The prototype's colors, fonts, radii and spacing are the preset's tokens.
Engineers take styles from the preset export (Customize → Export, or
sable preset), not code from the prototype.
Platform: iOS 27 on a 6.3" iPhone Pro. Chrome by Konsta UI 5.5 (MIT) through the adapter.
sable target ios --json
sable target ios --component Switch --json # preserve: Sable Switch
sable target ios --component BottomNav --json # replace: IosTabbar + IosTab
sable target ios --component Button --json # contextual: Sable except in the nav bar