Ballmac UI home

Resizable

Draggable split panels with keyboard resizing, nested horizontal and vertical groups, collapsible panels, and a grip that appears on hover and focus.

Explorer

  • app/page.tsx
  • app/layout.tsx
  • lib/utils.ts
  • package.json

app/page.tsx

export default function Page() {
  return <main>Hello, Acme</main>
}

Terminal

$ pnpm dev

ready on http://localhost:3000

Installation

$ pnpm dlx shadcn@latest add @ballmac/resizable

Usage

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

The full example is in the Code tab above.

Examples

Collapsible panel

Inbox

12 unread

Drag the handle, or focus it and use the arrow keys. Drag past the minimum to collapse.

API reference

PropTypeDefault
withHandle

Show a grip icon in the middle of the handle at all times (otherwise it appears on hover and focus).

booleanfalse
label

Accessible name of the separator, for example "Resize sidebar".

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
ArrowLeft / ArrowRight (ArrowUp / ArrowDown)Resize by 10% steps from the focused handle
Home / EndMove to minimum or maximum
EnterCollapse or expand a collapsible neighbor

Use with AI

ResizablePanelGroup with ResizablePanel children separated by ResizableHandle. Sizes are percentages. Give each handle a label. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Resizable (@ballmac/resizable) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • IDE, email and file-manager layouts
  • User-adjustable sidebars and consoles

Not for

  • Fixed layouts; use plain CSS grid
  • App navigation; use sidebar

Registry JSON: https://ui.ballmac.com/r/resizable.json

Credits

Based on shadcn/ui Resizable, adapted by Ballmac. Free to use in personal and commercial projects.