One Logo Pool Ball
wwwwwwwwwwwwwwwwwww

SplitView

Native UISplitViewController for iPad multi-column layouts under One.iOS.SplitView

One.iOS.SplitView is the native UISplitViewController from react-native-screens, for iPad multi-column layouts. SplitView.Column markers map to the native screen columns and the routed detail arrives through slot; SplitView.Inspector marks an inspector column the same way. On iPhone it collapses to a single column automatically.

Place SplitView in a root layout. It can render through Slot, but cannot be nested inside Stack, Tabs, Drawer, or another SplitView; One rejects that placement before mounting the native split controller.

Usage

import { Text } from 'react-native'
import { One } from 'one'
function SidebarContent() {
return <Text>Sidebar</Text>
}
function Detail() {
return <Text>Detail</Text>
}
function Layout() {
return (
<One.iOS.SplitView slot={Detail}>
<One.iOS.SplitView.Column>
<SidebarContent />
</One.iOS.SplitView.Column>
</One.iOS.SplitView>
)
}

How it works

The SplitView.Column and SplitView.Inspector markers must be direct children of SplitView; One maps them to the native screen columns and supplies the routed detail through slot. At most two columns are allowed, and a SplitView with no column or inspector warns and renders the slot alone. Only one SplitView may live in the navigation hierarchy, and one nested inside another navigator throws unless it renders through Slot.

SplitView requires react-native-screens gamma mode. Enable it in the One native app manifest:
import { one } from 'one/vite'
one({
native: {
app: {
name: 'MyApp',
ios: {
bundleId: 'com.example.myapp',
screensGamma: true,
},
android: { applicationId: 'com.example.myapp' },
},
},
})
one prebuild adds the Podfile setting before CocoaPods runs. For an existing native project that One did not generate, add ENV['RNS_GAMMA_ENABLED'] ||= '1' to the top of its Podfile.
SplitViewTypeDescription
childrenReactNodeColumn and Inspector markers.
ReactNodeColumn and Inspector markers.
slotReact.ComponentTypeThe routed detail column.
React.ComponentTypeThe routed detail column.
Column, InspectorTypeDescription
childrenReact.ReactNodeThe column content.
React.ReactNodeThe column content.

Platform differences

iOSAndroidWeb
RendersSplit columnsWarns, slot onlySlot only
CollapseOn iPhoneNoneNone

Off iOS, SplitView warns and renders the slot alone.

Limits and gotchas

Credit

The native split-view implementation is adapted from Expo Router.

Edit this page on GitHub.