Componentnavigation3.17 KB gzipZero dependencies
Resizable
Splitter layout panels with draggable resize handle, min/max limits and collapse button.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add resizableOr install the full npm package:
npm install bigbulluiUsage
tsx7 lines
import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@/components/ui/resizable"; <ResizablePanelGroup direction="horizontal"> <ResizablePanel defaultSize={50}>Left Panel</ResizablePanel> <ResizableHandle withHandle /> <ResizablePanel defaultSize={50}>Right Panel</ResizablePanel></ResizablePanelGroup>Source code
resizable.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxresizable.tsx622 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface ResizablePanelGroupProps extends React.HTMLAttributes<HTMLDivElement> { direction?: "horizontal" | "vertical"; onLayout?: (sizes: number[]) => void; notched?: boolean; className?: string; children: React.ReactNode;} export interface ResizablePanelProps extends React.HTMLAttributes<HTMLDivElement> { id?: string; defaultSize?: number; minSize?: number; maxSize?: number;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { ResizablePanelGroup } from "@/components/ui/resizable"; <ResizablePanelGroup />| Prop | Type | Description |
|---|---|---|
| direction | "horizontal" | "vertical" | Configures direction. (Default: "horizontal") |
| onLayout | (sizes: number[]) => void | Callback invoked on layout. |
| notched | boolean | Toggles notched. (Default: true) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |
| children | React.ReactNode | Child elements rendered inside the component. |