SwiftUI components
Use the system's own UI from React or Octane - tab bars, navigation bars, sheets, Liquid Glass buttons and form controls - with @bake-native/react/ui/swift-ui.
@bake-native/react/ui/swift-ui gives you SwiftUI views as React components, after @expo/ui. Everything inside a <Host> is drawn by SwiftUI itself on iOS and macOS. You get the system's tab bar, navigation bar, sheets and controls, and they follow the OS when its design changes, as Liquid Glass did on iOS 26.
Octane apps use the same component names from @bake-native/octane/ui/swift-ui.
It is the SwiftUI package of Native UI, next to the Universal components (@bake-native/react/ui), as @expo/ui/swift-ui is next to @expo/ui. Start with @bake-native/react/ui. Use SwiftUI directly only for what the Universal layer does not have.
import { useState } from 'octane';
import { Host, VStack, Text, Button, BottomSheet, Group, buttonStyle, font, padding, presentationDetents } from '@bake-native/octane/ui/swift-ui';
export function App() @{
const [open, setOpen] = useState(false);
<Host matchContents>
<VStack spacing={12} modifiers={[padding({ all: 16 })]}>
<Text modifiers={[font({ textStyle: 'headline' })]}>Hello</Text>
<Button label="Open" systemImage="sparkles" onPress={() => setOpen(true)} modifiers={[buttonStyle('glassProminent')]} />
</VStack>
<BottomSheet isPresented={open} onIsPresentedChange={setOpen}>
<Group modifiers={[presentationDetents(['medium', 'large'])]}>
<Text>A native sheet</Text>
</Group>
</BottomSheet>
</Host>
}| iOS 26: Form, tab bar, navigation bar | iOS 26: bottom sheet | macOS |
|---|---|---|
![]() | ![]() | ![]() |
The full screen above is examples/swift-ui.
Host
A Host is one box in your page. Its SwiftUI content is laid out by SwiftUI, not CSS.
| Prop | Meaning |
|---|---|
class, style | Size and place the Host like any element, e.g. style={{ height: '100vh' }} for a TabView |
matchContents | Size the Host to its SwiftUI content instead. { vertical: true } keeps the CSS width |
colorScheme | 'light' or 'dark'. By default the content follows the page's CSS color-scheme |
Components outside a Host draw nothing on native.
@expo/ui's ignoreSafeArea is not a Host prop here: SwiftUI never sees the Host's own box, which CSS lays out. Passing it is a build error (ui-swift-ui-prop) on every target. To run content under the bars, put the ignoresSafeArea() modifier on the Host's content and size the Host with CSS.
Components
The names, props and behavior are SwiftUI's. State is controlled from JS: pass the value and handle its change callback.
| Component | Props |
|---|---|
VStack, HStack, ZStack | alignment, spacing |
Spacer, Divider, Group, ScrollView | minLength; axes, showsIndicators |
Text, Label, Image | children; title, systemImage; systemName, size, color (SF Symbols) |
Button | label, systemImage, role ('destructive', 'cancel'), onPress |
Toggle | label, isOn, onIsOnChange(isOn) |
Slider | value, min, max, step, onValueChange(value) |
Picker | label, selection, onSelectionChange(value); options are children with a tag(value) modifier |
TextField | placeholder, text, onTextChange(text), onSubmit, autoCapitalize, autoCorrect, inputMode, enterKeyHint |
SecureField | placeholder, text, onTextChange(text), onSubmit |
ProgressView | value, total (no value: a spinner) |
Menu | label, systemImage; children are its items |
Form, List, Section | title, footer |
NavigationStack, ToolbarItem | the system navigation bar; placement |
TabView, Tab | selection, onSelectionChange; value, title, systemImage, badge |
BottomSheet | isPresented, onIsPresentedChange, fitToContents |
GlassEffectContainer | spacing (iOS 26 / macOS 26) |
Modifiers
Modifiers are passed as data and applied in order, as SwiftUI chains them: modifiers={[padding({ all: 16 }), glassEffect()]}.
padding, frame, background, foregroundStyle, font, bold, italic, tint, buttonStyle ('glass', 'glassProminent', 'borderedProminent'…), controlSize, glassEffect, cornerRadius, clipShape, opacity, shadow, disabled, pickerStyle, toggleStyle, labelsHidden, accessibilityLabel, multilineTextAlignment, lineLimit, tag, presentationDetents, presentationDragIndicator, presentationBackgroundInteraction, interactiveDismissDisabled, navigationTitle, navigationBarTitleDisplayMode, toolbarBackground, toolbarColorScheme, toolbarVisibility, environment, ignoresSafeArea, listStyle, scrollContentBackground.
Colors are SwiftUI names ('primary', 'secondary', 'blue'…) or any CSS color. On systems before iOS 26 / macOS 26, the glass styles fall back to bordered styles and materials.
Add accessibilityLabel('Settings') to a button that shows just the gearshape symbol. SwiftUI reads the label with VoiceOver. On the web, the button uses aria-label.
Headers
NavigationStack is the system navigation bar (Liquid Glass on iOS 26). Configure it with modifiers on its content, as in SwiftUI:
| To | Modifier |
|---|---|
| Set the title | navigationTitle('Stats'), navigationBarTitleDisplayMode('inline' | 'large') |
| Make the header transparent | toolbarBackground('hidden') |
| Give it a color | toolbarBackground('#0b3d2e') |
| Hide it | toolbarVisibility('hidden') |
| Add buttons | <ToolbarItem placement="topBarTrailing">…</ToolbarItem> among the stack's children |
The same modifiers take a second argument for the tab bar: toolbarBackground('hidden', 'tabBar').
A transparent header over a dark background needs light text. SwiftUI applies toolbarColorScheme('dark') only while the bar has a background, so set the color scheme on the whole stack instead:
<NavigationStack modifiers={[environment('colorScheme', 'dark')]}>
<ScrollView modifiers={[navigationTitle('Stats'), toolbarBackground('hidden'), background('#0b3d2e')]}>
…
</ScrollView>
</NavigationStack>
On the web
There is no SwiftUI in the browser, so each component renders a plain HTML stand-in: flex stacks, buttons, inputs, a fixed bottom sheet and a tab bar. The modifiers that have a CSS meaning are applied as inline styles. The same screen works there, but it is not meant to match the native look pixel for pixel. A web build with @bake-native/react/ui/swift-ui succeeds; it is the one target without SwiftUI where these components draw something.
Before JS runs
A Host's SwiftUI tree is stored in the baked first frame, so the native UI is on screen before Hermes starts, and the app takes it over without creating a new view.
Page content inside SwiftUI
BakeView puts your usual elements and CSS inside the SwiftUI tree, as @expo/ui's RNHostView does. It takes the width SwiftUI gives it and is as tall as its content. Taps and state work as anywhere else in the page.
<BottomSheet isPresented={open} onIsPresentedChange={setOpen}>
<VStack modifiers={[padding({ all: 24 })]}>
<BakeView class="card">
<h3>CSS inside SwiftUI</h3>
<button onClick={…}>Tap</button>
</BakeView>
</VStack>
</BottomSheet>
For a native header over a whole CSS screen, use Header from @bake-native/react/ui rather than wrapping the screen in a NavigationStack.
Platforms
| Target | What draws a Host |
|---|---|
| iOS, macOS | SwiftUI |
| Web | the HTML stand-in (see On the web) |
| Android, Windows | nothing can draw it, so it is a build error (ui-swift-ui-target) |
On Android and Windows, bake build reports every SwiftUI component the app renders, at its line, and fails:
src/App.tsrx:8:4: error: `<Host>` of `@bake-native/react/ui/swift-ui` is not supported on android: SwiftUI components are drawn only on ios and mac (the web gets HTML approximations), so on android they would draw nothing. Instead: the Universal components of `@bake-native/react/ui` (every target), or render the SwiftUI screen only in a branch on import.meta.env.BAKE_TARGET ('ios' / 'mac') and something else on the other targets (ui-swift-ui-target).There are two ways out. Use @bake-native/react/ui for a screen that runs everywhere. Or keep the SwiftUI screen for Apple platforms and render it in a template branch on the target, with something else on the other targets:
import { Host, Toggle } from '@bake-native/octane/ui/swift-ui';
import { Switch } from '@bake-native/octane/ui';
const APPLE = import.meta.env.BAKE_TARGET === 'ios' || import.meta.env.BAKE_TARGET === 'mac';
export function Settings() @{
@if (APPLE) {
<Host matchContents>
<Toggle label="Wi-Fi" isOn={wifi} onIsOnChange={setWifi} />
</Host>
} @else {
<Switch label="Wi-Fi" value={wifi} onValueChange={setWifi} />
}
}The branch is a build-time constant, so on Android and Windows the SwiftUI side is dead and not checked. The check looks at what is rendered, not at the import. A JS choice between two components (const S = APPLE ? AppleSettings : UniversalSettings) does not count: the component that uses SwiftUI stays in the bundle, so the build still fails.
The Android package, @bake-native/react/ui/jetpack-compose, is coming soon.
Not yet
@expo/ui/swift-uicomponents this package does not have:DatePicker,ColorPicker,Stepper,Gauge,ContextMenu,DisclosureGroup,ShareLink.- A full build-time check of components, props and modifiers, as
@bake-native/react/uihas. Today the build checks the target (ui-swift-ui-target) and the Host'signoreSafeArea(ui-swift-ui-prop).
Universal UI
One component tree for every target with @bake-native/react/ui - the @expo/ui Universal components (Host, Column, Row, Spacer, Text, Button, Switch, Checkbox, Slider, Picker, TextInput) plus Header and TabBar.
Jetpack Compose
The planned Android UI package, @bake-native/octane/ui/jetpack-compose, and what Android draws until it ships.


