# SplitPane

Give two working regions the space they need, with a real resizable boundary.

- Family: Layout, imported from `mizu-ui` or `mizu-ui/layout`
- Docs: https://mizu.user64bit.world/components/split-pane
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/layout/SplitPane.tsx

## Usage

```tsx
"use client";

import { useState } from "react";
import { SplitPane } from "mizu-ui";

export function Example() {
  const [value, setValue] = useState(45);
  return (
    <SplitPane
      value={value}
      onValueChange={setValue}
      first={
        <div>
          <h3>Source</h3>
          <p className="mizu-field-hint">
            Drag the divider or focus it and use the arrow keys.
          </p>
        </div>
      }
      second={
        <div>
          <h3>Preview</h3>
          <p className="mizu-field-hint">
            This panel receives {100 - value}% of the available space.
          </p>
        </div>
      }
    />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/split-pane
```

## Props

- `first / second`: `ReactNode`. Two independent panels.
- `value / onValueChange`: `number / function`. Controlled percentage given to the first panel.
- `min / max / label`: `number / number / string` (default `15 / 85`). Bounds and separator name.

## Accessibility

Focusable separator with orientation, controls and current/min/max values. Arrow keys move 1%, Shift moves 10%; Home/End reach bounds. Pointer capture supports touch.

## Motion

Direct manipulation, no spring lag.
