# Resizable

> Two panels separated by a draggable, keyboard-accessible splitter.

- Category: [Window & layout](https://tarve.dev/docs.md#layout)
- Import: `import { Resizable } from "@tarve/core";`
- Props type: `ResizableProps`
- Source: [packages/core/src/advanced-controls.ts:222](https://github.com/omarcosr/tarve/blob/main/packages/core/src/advanced-controls.ts#L222)

## Usage

```tsx title="Resizable.tsx"
import { Resizable, Text } from "@tarve/core";

let split = 30;

<Resizable
  size={split}
  min={20}
  max={70}
  onSizeChange={(size) => {
    split = size;
  }}
  first={<Text>Sidebar</Text>}
  second={<Text>Editor</Text>}
  style={{ height: 320 }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `first` (required) | `Child` | — |  |
| `second` (required) | `Child` | — |  |
| `size` (required) | `number` | — |  |
| `disabled` | `boolean` | — |  |
| `label` | `string` | `"Resize panels"` |  |
| `max` | `number` | `90` |  |
| `min` | `number` | `10` |  |
| `onSizeChange` | `(size: number) => void` | — |  |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` |  |
| `step` | `number` | `1` |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

Previous: [Pressable](https://tarve.dev/docs/components/Pressable.md) · Next: [AspectRatio](https://tarve.dev/docs/components/AspectRatio.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Resizable · Index for agents: https://tarve.dev/llms.txt
