# State-tracked resizable layout.

> State-tracked resizable layout.

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-resizable-10).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-resizable-10
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-resizable-10-light-9438a949910afae5.png
- Registry item: https://reui.io/r/new-york-v4/c-resizable-10.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-resizable-10.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `resizable`

## Files

### `c-resizable-10.tsx`

```tsx
"use client"

import { useState } from "react"

import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup,
} from "@/components/ui/resizable"

export function Pattern() {
  const [sizes, setSizes] = useState<Record<string, number>>({
    left: 30,
    right: 70,
  })

  return (
    <div className="mx-auto w-full max-w-lg">
      <ResizablePanelGroup
        orientation="horizontal"
        className="rounded-2xl min-h-[200px] border"
        onLayoutChange={(layout) => {
          setSizes(layout)
        }}
      >
        <ResizablePanel id="left" defaultSize={30} minSize={20}>
          <div className="flex h-full flex-col items-center justify-center gap-2 p-6">
            <span className="text-sm font-semibold">
              {Math.round(sizes.left ?? 30)}%
            </span>
          </div>
        </ResizablePanel>
        <ResizableHandle withHandle />
        <ResizablePanel id="right" defaultSize={70} minSize={30}>
          <div className="flex h-full flex-col items-center justify-center gap-2 p-6">
            <span className="text-sm font-semibold">
              {Math.round(sizes.right ?? 70)}%
            </span>
          </div>
        </ResizablePanel>
      </ResizablePanelGroup>
    </div>
  )
}
```
