suiss/ui ยท Pattern
Split View
A two- or three-column sidebar, list and detail layout that becomes a push navigation stack on mobile.
Split View is an open-source pattern from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
SplitView arranges content in up to three columns, like Mail: a sidebar, a list and a detail pane. On desktop it places the panes in a horizontal suiss/ui ResizablePanelGroup with resize handles between them. On mobile (below 48rem, via useIsMobile) only one column shows at a time, and tapping a SplitViewItem pushes the next column.
Use it for master-detail interfaces such as mail, settings or file browsers.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Usage
Examples
Two columns
Leave out SplitViewSidebar for a two-column list and detail layout.
Start on sidebar
Set defaultColumn="sidebar" to start on the sidebar column on mobile.
Accessibility
- Each pane is a
sectionlabelled by itstitleheading, so titled panes are exposed as regions. - The active item has
aria-current="true". - On mobile, navigating moves focus to the new pane's heading. The back button's chevron is hidden from assistive technology.
API Reference
SplitView
The root that lays out the panes and tracks the visible mobile column.
| Prop | Type | Default |
|---|---|---|
column | SplitViewColumn | - |
defaultColumn | SplitViewColumn | "list" |
onColumnChange | (column: SplitViewColumn) => void | - |
Also accepts the props of React.ComponentProps<"div">.
Place SplitViewSidebar, SplitViewList and SplitViewDetail as direct children. On desktop the panes default to 20%, 32% and 48% of the width, with minimum sizes of 15%, 22% and 30%. The mobile column is uncontrolled by default and starts at defaultColumn; use column with onColumnChange to control it. On mobile the root sets data-column to the visible column. useSplitView returns isMobile, column and setColumn for custom navigation inside the view.
SplitViewSidebar
The leading pane, usually for sources or categories.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | - |
Also accepts the props of React.ComponentProps<"section">.
title is the pane heading and accessible name. It also labels the back button in the list pane, which shows a back button to the sidebar only when the sidebar has a title.
SplitViewList
The middle pane, usually a list of items.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | - |
Also accepts the props of React.ComponentProps<"section">.
title is visually hidden on desktop and labels the back button in the detail pane.
SplitViewDetail
The trailing pane that shows the selected item.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | - |
Also accepts the props of React.ComponentProps<"section">.
SplitViewItem
A button row that marks the current selection and advances to the next column on mobile.
| Prop | Type | Default |
|---|---|---|
isActive | boolean | false |
Also accepts the props of useRender.ComponentProps<"button">.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
Also accepts the props of React.ComponentProps<"button">.
| Prop | Type | Default |
|---|---|---|
render | (props: React.HTMLAttributes<HTMLElement>) => React.ReactNode | - |
Also accepts the props of React.ComponentProps<"button">.
On mobile it advances to the next column on click and runs your own onClick too. Set isActive on the current item; it sets aria-current and data-active.
Use the render prop to render it as a link.
Set asChild and pass a link as the child to render it as a link.
Pass a render function that returns a link with the props it receives.
Each part sets a data-slot, such as split-view-list, split-view-back or split-view-list-panel, for styling.
Web preview
SplitView lays out up to three panes: SplitViewSidebar, SplitViewList and SplitViewDetail. When the window is at least breakpoint wide (768 by default), they sit side by side in a bordered row, sized 20, 32 and 48 parts.
Below the breakpoint only the current column is shown, full screen and scrollable, with a large title. Pressing a SplitViewItem moves to the next column, and a back button titled with the previous pane returns to it. Use it for mail, notes or settings screens that drill down.
On Android the hardware back button also returns to the previous column.
Installation
- Install the following dependencies:
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/patterns/split-view.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/patterns/split-view.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/patterns/split-view.tsx:
- Update the import paths to match your project setup.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
Detail column
Starts on the detail column.

Start on sidebar
Starts on the sidebar column.
Web preview
Two columns
Only list and detail panes, without a sidebar.
Web preview
Accessibility
- Pane titles have the
headingrole, and panes are labelled by string titles. - On phones, screen reader focus moves to the new pane's heading after navigating.
SplitViewItemexposes itsselectedstate.- Back and row chevrons mirror in right-to-left layouts.
API Reference
SplitView
The root that tracks the current column and the layout mode.
| Prop | Type | Default |
|---|---|---|
column | SplitViewColumn | - |
defaultColumn | SplitViewColumn | "list" |
onColumnChange | (column: SplitViewColumn) => void | - |
breakpoint | number | 768 |
Also accepts the props of ViewProps.
The current column is uncontrolled with defaultColumn or controlled with column and onColumnChange. breakpoint is the window width at which the panes sit side by side. On phones the new pane fades in, respecting the system reduce motion setting. useSplitView returns isCompact, column and setColumn for custom navigation.
SplitViewSidebar
The first pane, for top-level sections.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | - |
Also accepts the props of ViewProps.
Give each pane a title; the back button only appears when the previous pane exists and has a title.
SplitViewList
The middle pane, for the items in a section.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | - |
Also accepts the props of ViewProps.
SplitViewDetail
The last pane, for the selected item.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | - |
Also accepts the props of ViewProps.
SplitViewItem
A pressable row that moves to the next column.
| Prop | Type | Default |
|---|---|---|
isActive | boolean | false |
children | React.ReactNode | - |
Also accepts the props of React.ComponentProps<typeof Pressable>.
Put items in the sidebar and list panes, and use their onPress to set the selection in your own state. isActive highlights the row and marks it as selected.
SplitViewColumn
Values: .sidebar, .list, .detail.
SplitView
The root that tracks the current column and the layout mode.
| Parameter | Type | Default |
|---|---|---|
column | Binding<SplitViewColumn> | - |
content | () -> Content | - |
defaultColumn | SplitViewColumn: .sidebar | .list | .detail | .list |
Overloads: init(column:content:), init(defaultColumn:content:).
SplitViewSidebar
The first pane, for top-level sections.
| Parameter | Type | Default |
|---|---|---|
_ย title | LocalizedStringKey? | nil |
content | () -> Content | - |
verbatim | String | - |
Overloads: init(_:content:), init(verbatim:content:).
SplitViewList
The middle pane, for the items in a section.
| Parameter | Type | Default |
|---|---|---|
_ย title | LocalizedStringKey? | nil |
content | () -> Content | - |
verbatim | String | - |
Overloads: init(_:content:), init(verbatim:content:).
SplitViewDetail
The last pane, for the selected item.
| Parameter | Type | Default |
|---|---|---|
_ย title | LocalizedStringKey? | nil |
content | () -> Content | - |
verbatim | String | - |
Overloads: init(_:content:), init(verbatim:content:).
SplitViewItem
A pressable row that moves to the next column.
| Parameter | Type | Default |
|---|---|---|
isActive | Bool | false |
action | (() -> Void)? | nil |
label | () -> Label | - |
SplitViewColumn
Values: Sidebar, List, Detail.
SplitViewScope.SplitViewSidebar
| Parameter | Type | Default |
|---|---|---|
title | String? | null |
modifier | Modifier | Modifier |
content | @Composable ColumnScope.() -> Unit | - |
SplitViewScope.SplitViewList
| Parameter | Type | Default |
|---|---|---|
title | String? | null |
modifier | Modifier | Modifier |
content | @Composable ColumnScope.() -> Unit | - |
SplitViewScope.SplitViewDetail
| Parameter | Type | Default |
|---|---|---|
title | String? | null |
modifier | Modifier | Modifier |
content | @Composable ColumnScope.() -> Unit | - |
SplitView
The root that tracks the current column and the layout mode.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
column | SplitViewColumn?: Sidebar | List | Detail | null |
defaultColumn | SplitViewColumn: Sidebar | List | Detail | SplitViewColumn.List |
onColumnChange | (SplitViewColumn) -> Unit | {} |
content | SplitViewScope.() -> Unit | - |
SplitViewItem
A pressable row that moves to the next column.
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
isActive | Boolean | false |
onClick | () -> Unit | {} |
content | @Composable ColumnScope.() -> Unit | - |
