Reading the reference

How SwiftUI initializers, parameters and modifiers map to React.

Reference pages follow Apple's documentation: a declaration, an overview, then topics. Use the React / Swift switch at the top of a page to see every declaration either way. The choice is remembered across pages.

One component, many initializers

A SwiftUI view usually has several initializers. Each one is listed under Initializers, and each is one way to render the component. You pick one by the props you pass:

Button("Sign In", systemImage: "arrow.up", action: signIn)
<Button systemImage="arrow.up" onPress={signIn}>Sign In</Button>

The props are the union of the initializers, so TypeScript tells you when a combination doesn't match any of them.

How parameters become props

Swift parameterReact
The only @ViewBuilder, or one named content, rowContent or labelchildren
Other view buildersNamed props that take React content
A leading unlabeled string, with no view builderText children: <Toggle isOn={b}>Wi-Fi</Toggle>
Binding<T>A binding from useBinding, or an observable's $property
An action closureAn event prop: action becomes onPress
(Data.Element) -> Content with _ data: Datadata plus a render function as children
A value type such as Font or Edge.SetA typed value: 'title', or SwiftUI.Font.title

Each prop lists its Swift parameter next to its type, so you can map it back to Apple's docs.

Availability

Under each title, the iOS version is the one that matters: swiftui-react-native renders on iOS. SwiftUI's availability on other platforms is listed after it, for reference.

Searching

Press ⌘K anywhere to search every component, modifier, value and guide.