---
title: "Split Page · Base UI — StyleX Blocks"
description: "Master–detail layouts pairing a list pane with a detail content pane."
url: "https://stylexblocks.com/components/base-ui/split-page/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Split Page

Master–detail layouts pairing a list pane with a detail content pane.

- Behavior engine: Base UI
- Also available for: [Ark UI](https://stylexblocks.com/components/ark-ui/split-page.md), [UI SDK](https://stylexblocks.com/components/ui-sdk/split-page.md)
- Category: Layout
- HTML page: https://stylexblocks.com/components/base-ui/split-page/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init --style base-ui
```

Then add the item as source you own:

```sh
npx stylexblocks add split-page
```

Equivalent: `npx shadcn add @stylexblocks/split-page`. Registry item JSON: https://stylexblocks.com/r/base-ui/split-page.json

## Usage

```tsx
import { SplitPage, splitPageContentMobile } from "#components/ui/base-ui/split-page.tsx";

export function Example() {
  return (
    // Root lays the master list pane next to Content (the detail pane);
    // composition per part via render. On mobile widths promote the detail
    // to an overlay: <SplitPage.Content style={splitPageContentMobile}>
    <SplitPage.Root>
      <nav>{/* list pane */}</nav>
      <SplitPage.Content>{/* detail pane */}</SplitPage.Content>
    </SplitPage.Root>
  );
}
```

## Source

`components/ui/base-ui/split-page.tsx`

```tsx
import * as stylex from "@stylexjs/stylex";
import { createSlotRecipeContext } from "#lib/base-ui/create-slot-recipe-context.tsx";
import { defineSlotRecipe } from "#lib/recipe-props.ts";
import { zIndices } from '@stylexblocks/ui/tokens/z-indices.stylex.ts'

const splitPageRoot = stylex.create({
  base: {
    display: 'flex',
    flex: 1,
    position: 'relative',
    overflow: 'hidden',
    flexDirection: 'row',
  },
})

const splitPageContent = stylex.create({
  base: {
    display: 'flex',
    flex: 1,
    height: '100%',
  },
})

const splitPageContentMobiles = stylex.create({
  true: {
    transitionProperty: 'right',
    position: 'absolute',
    zIndex: zIndices.layer1,
    top: 0,
    bottom: 0,
    width: '100vw',
  },
})

export type SplitPageMobile = keyof typeof splitPageContentMobiles

// defineSlotRecipe validates the shape at compile time. The generated mobile
// map is a boolean overlay with no `false` counterpart to default to, so it
// is exported as a composable style instead of a variant axis.
const splitPageSlotRecipe = defineSlotRecipe({
  slots: {
    root: { styles: splitPageRoot },
    content: { styles: splitPageContent },
  },
  defaultVariants: {},
});

/**
 * SplitPage — recipe and component colocated in one file; each part composes
 * via `render`. Root lays out the master list pane next to Content (the
 * detail pane). On mobile widths, promote Content to an overlay with
 * `<SplitPage.Content style={splitPageContentMobile}>`.
 */
const { withProvider, withContext } =
  createSlotRecipeContext(splitPageSlotRecipe);

export const splitPageContentMobile = splitPageContentMobiles.true;

export const SplitPage = {
  Root: withProvider("div", "root", "SplitPageRoot"),
  Content: withContext("div", "content", "SplitPageContent"),
};
```
