---
title: "Resizable Panel | Free React & Tailwind Blocks Component | Motion UI"
canonical: "https://blacknest.dev/motion/c/blocks/resizable-panel"
github_source: "https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/resizable-panel.tsx"
install_command: "npx motion-ui-skill add resizable-panel"
dependencies: ["clsx","lucide-react","motion","react","tailwind-merge"]
category: "blocks"
subcategory: "motion"
---

# Resizable Panel

> Accessible multi-direction split container with smooth pointer dragging, keyboard ratio controls, and boundary snapping. Inspired by shadcn/ui and React Resizable Panels.

## Install

```bash
npx motion-ui-skill add resizable-panel
```

## Dependencies

- `clsx`
- `lucide-react`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { ResizablePanelGroup } from "@/components/motion/resizable-panel";

export function ResizablePanelExample() {
  return (
    <div className="h-96 w-full p-4">
      <ResizablePanelGroup
        direction="horizontal"
        defaultSize={40}
        minSize={25}
        maxSize={75}
        panelA={
          <div className="p-4 bg-muted/20 h-full">
            <h3 className="text-sm font-semibold">Left Sidebar</h3>
            <p className="text-xs text-muted-foreground mt-2">File tree and navigation</p>
          </div>
        }
        panelB={
          <div className="p-4 bg-card h-full">
            <h3 className="text-sm font-semibold">Editor Surface</h3>
            <p className="text-xs text-muted-foreground mt-2">Main workspace</p>
          </div>
        }
      />
    </div>
  );
}
```

## Props

| Prop | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `direction` | `"horizontal" \| "vertical"` | `"horizontal"` | Split orientation. |
| `defaultSize` | `number` | `50` | Default percentage width/height for panel A. |
| `minSize` | `number` | `20` | Minimum percentage for panel A. |
| `maxSize` | `number` | `80` | Maximum percentage for panel A. |
| `panelA` | `React.ReactNode` | Required | First panel content. |
| `panelB` | `React.ReactNode` | Required | Second panel content. |
| `onResize` | `(size: number) => void` | `undefined` | Callback invoked when split ratio changes. |
| `className` | `string` | `undefined` | Outer container classes. |

## Source Files

- [components/motion/resizable-panel.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/resizable-panel.tsx)
- [lib/hooks/use-haptic.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-haptic.ts)
- [lib/utils.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/utils.ts)
