Skip to content

API Reference ​

expo-split-view exposes compound components as well as direct named exports and hooks.

Available Exports ​

ExportTypeDescription
<SplitView>ComponentRoot layout component (renders left master pane and right <Stack />).
<SplitView.Placeholder> / SplitViewPlaceholderComponentDisplays master list on phone, placeholder on tablet.
<SplitView.Detail> / SplitViewDetailComponentDetail screen container with auto-bound edge-swipe gestures.
<BackIcon> / BackIconComponentPlatform-adaptive back icon with automatic RTL handling and theme support.
useSplitView(breakpoint?)HookProvides { isTablet, width, navigate(href) }.
useDetailScreenBack(options)HookConfigures header back button, Android back handler, and edge-swipe gesture.
useCustomLeftHeader()HookHook for master list components in the left pane to access { canGoBack, goBack }.

<SplitView /> ​

The root coordinator placed in your route group's _layout.tsx.

tsx
import { SplitView } from 'expo-split-view';

Props ​

PropTypeDefaultDescription
masterListReactNoderequiredThe master list element to render in the left pane.
masterListWidthnumber320Width of the left pane on tablets (in dp / points).
tabletBreakpointnumber768Viewport width threshold (in points) for tablet layout.
containerStyleStyleProp<ViewStyle>undefinedStyles applied to the root container.
masterStyleStyleProp<ViewStyle>undefinedStyles applied to the master (left) pane wrapper.
detailStyleStyleProp<ViewStyle>undefinedStyles applied to the detail (right) pane wrapper.
stackScreenOptionsNativeStackNavigationOptions{ headerShown: true }Screen options passed to the underlying Expo Router <Stack />.
safeAreaEdgesArray<'top' | 'left' | 'right' | 'bottom'>['left', 'right', 'bottom']Safe-area edges consumed by <SplitView>. 'top' is excluded by default to avoid double status-bar padding.
leftHeaderboolean | ((ctx: SplitViewLeftHeaderValueProps) => ReactNode)falseLeft pane header. true renders built-in header with back button; a function lets you render custom header controls.
leftHeaderTitlestringundefinedTitle text displayed in the built-in sidebar header.
renderBackIcon() => ReactNodeundefinedCustom back icon renderer for the built-in sidebar header.
leftHeaderHeightnumber56Height in dp of the left sidebar header (excluding safe-area top inset).
leftHeaderBackIconColorstringundefinedTint color for the built-in sidebar header back icon.
childrenReactNodeundefinedCustom content for the right pane (overrides <Stack />).

<SplitView.Placeholder /> ​

Index component placed in your route group's root index.tsx. Also available as named export SplitViewPlaceholder.

tsx
import { SplitView } from 'expo-split-view';
// or
import { SplitViewPlaceholder } from 'expo-split-view';

Props ​

PropTypeDefaultDescription
masterListReactNoderequiredThe master list element rendered full-screen on phones.
placeholderReactNodeundefinedCustom placeholder element for tablets.
placeholderTextstring'Select an item from the left pane'Text displayed in default tablet placeholder.
tabletBreakpointnumber768Viewport width threshold (in points) for tablet layout.
placeholderContainerStyleStyleProp<ViewStyle>undefinedStyle for the tablet placeholder container.
placeholderTextStyleStyleProp<TextStyle>undefinedStyle for the tablet placeholder text.

<SplitView.Detail /> ​

Detail container component placed in your route group's [id]/index.tsx. Also available as named export SplitViewDetail.

tsx
import { SplitView } from 'expo-split-view';
// or
import { SplitViewDetail } from 'expo-split-view';

Props ​

PropTypeDefaultDescription
childrenReactNoderequiredThe content of the detail screen.
styleStyleProp<ViewStyle>undefinedContainer view style.
backOptionsUseDetailScreenBackOptionsundefinedConfiguration options passed directly to useDetailScreenBack.

useSplitView() ​

Helper hook that simplifies responsive layout detection and navigation across tablets and phones.

tsx
import { useSplitView } from 'expo-split-view';

const { isTablet, width, navigate } = useSplitView(breakpoint?);

Parameters ​

  • breakpoint (number, optional, default 768): The minimum width in dp to be considered a tablet layout.

Return Value (UseSplitViewResult) ​

PropertyTypeDescription
isTabletbooleantrue if current viewport width >= breakpoint.
widthnumberCurrent screen width in points / dp.
navigate(href: Href) => voidNavigates to a detail route: uses router.replace(href) on tablet and router.push(href) on phone.

useDetailScreenBack() ​

Custom hook for detail screens providing resilient back navigation and gestures when rotating between tablet and mobile layouts.

tsx
import { useDetailScreenBack } from 'expo-split-view';

const {
  showCustomMobileBack,
  handleBack,
  panHandlers,
  isTablet,
  hasIndexInHistory,
} = useDetailScreenBack(options);

Options (UseDetailScreenBackOptions) ​

OptionTypeDefaultDescription
fallbackRouteHrefparent routeTarget fallback route if the master list is absent from stack history (dynamically drops the active screen segment, or '/').
titlestringundefinedHeader title string.
tabletBreakpointnumber768Viewport width threshold (in points) for tablet layout.
backTitlestring | null'Back'Back button label on iOS (pass "" or null to hide).
showHeaderButtonbooleantrueAutomatically inject custom back button when required.
tintColorColorValuetheme-adaptiveCustom tint color for back chevron and text (defaults to black in light mode and white in dark mode).
masterRouteNamestring'index'Name of the master list route to search for in navigation history.
isMasterRoute(routeName: string) => booleanundefinedCustom predicate function to match the master list screen in stack history.
onFallback() => voidundefinedCustom callback invoked on fallback navigation (e.g. for custom modals or bottom sheets).
disableEdgeSwipeGesturebooleanfalseDisable edge-swipe back gesture handling (e.g. inside swipeable tabs or bottom sheets).
renderBackIcon(props: { color?: ColorValue }) => ReactNodeundefinedCustom back icon renderer (defaults to chevron <).

Return Value (UseDetailBackResult) ​

PropertyTypeDescription
showCustomMobileBackbooleantrue when custom back behavior is active (phone & index absent from history).
handleBack() => voidExecutes safe back action (router.back() or fallback).
panHandlersGestureResponderHandlersTouch handlers for iOS edge-swipe back gesture. Handled automatically when using <SplitView.Detail>.
isTabletbooleantrue if current viewport width >= tabletBreakpoint.
hasIndexInHistorybooleantrue if index route exists in current stack navigation history.
isTabletAtRootbooleantrue when on tablet and at the root of the navigation stack. Back is intercepted to return to placeholder/fallback instead of exiting the app.

useCustomLeftHeader() ​

Custom hook for master list components rendered inside the left pane. Use together with leftHeader={false} (default) on <SplitView> to build your own custom header or back navigation inside the master list.

tsx
import { useCustomLeftHeader } from 'expo-split-view';

const { canGoBack, goBack } = useCustomLeftHeader();

Return Value (SplitViewLeftHeaderValueProps) ​

PropertyTypeDescription
canGoBackbooleantrue when the screen hosting the split view has a previous screen in the outer navigator.
goBack() => voidSafely pops the screen hosting the split view (never pops right-pane screens).

Behavior Outside Sidebar

Outside the left sidebar (for example, on phones where MasterList is rendered in the root index screen), it safely returns { canGoBack: false, goBack: () => {} }.

<BackIcon /> ​

Reusable platform-adaptive back icon component rendering iOS chevron (back-ios.png) or Android arrow (back-android.png) based on Platform.OS. Automatically handles RTL mirroring via I18nManager.isRTL and adapts to light/dark color schemes.

tsx
import { BackIcon } from 'expo-split-view';

<BackIcon color="#007AFF" size={24} />

Props (BackIconProps) ​

PropTypeDefaultDescription
colorColorValuetheme-adaptiveTint color. Defaults to black in light mode (#000000) and white in dark mode (#FFFFFF).
sizenumber22 (iOS) / 24 (other)Rendered icon size in dp.
styleStyleProp<ImageStyle>undefinedAdditional styles applied to the icon image.

Types ​

SplitViewLeftHeaderValueProps ​

Context value passed to the leftHeader render function and returned by useCustomLeftHeader():

tsx
export type SplitViewLeftHeaderValueProps = {
  /** True when the screen hosting the split view has a previous screen to return to. */
  canGoBack: boolean;
  /** Pops the screen hosting the split view. Never pops right-pane screens. */
  goBack: () => void;
};

BackIconProps ​

Props accepted by <BackIcon />:

tsx
export type BackIconProps = {
  /** Tint color. Defaults to black in light mode and white in dark mode. */
  color?: ColorValue;
  /** Rendered size in dp. Defaults to 22 on iOS and 24 elsewhere. */
  size?: number;
  style?: StyleProp<ImageStyle>;
};

Released under the MIT License.