Componentnavigation3.17 KB gzipZero dependencies

Resizable

Splitter layout panels with draggable resize handle, min/max limits and collapse button.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add resizable

Or install the full npm package:

npm install bigbullui

Usage

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 helper

Zero 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 />
PropTypeDescription
direction"horizontal" | "vertical"Configures direction. (Default: "horizontal")
onLayout(sizes: number[]) => voidCallback invoked on layout.
notchedbooleanToggles notched. (Default: true)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.
childrenReact.ReactNodeChild elements rendered inside the component.