Skip to content
Haze UI

Resizable Panel

Lets users resize two adjacent panes with a drag handle or keyboard, then stacks them in narrow containers.

pnpm dlx shadcn@latest add @haze/resizable-panel
Open preview in a new tab
Livesmall script

When to use

  • Two panes share space, such as files and an editor.
  • The desired reading width varies by task or document.

When not to use

  • One panel can expand without competing with another panel for space.

Installation

Add the Haze registry to components.json once, then install Resizable Panel with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/resizable-panel
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
id*string–ID prefix for the pane linked to the resize handle.
labelstringResize panelsAccessible name for the separator.
startSizenumber42Initial percent assigned to the first pane.
classstring–Classes for the container.

Keyboard interactions

←→
Resize by five percentage points. Add Shift to resize by ten.
HomeEnd
Move to the minimum or maximum width.

Accessibility

  • The separator announces the current size as a percentage.
  • On narrow screens the panes stack in reading order.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Resizable Panel" with `npx shadcn@latest add @haze/resizable-panel`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ResizablePanel from "@/components/haze/ui/resizable-panel.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/resizable-panel.md

  • Customize with real content

    Adapt the Haze resizable-panel ui for our product. Replace the demo values of these props with our real content: id, label, startSize, class. Keep the layout, the heading level rules and these accessibility details: The separator announces the current size as a percentage. On narrow screens the panes stack in reading order. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using resizable-panel, check it fits: use it when two panes share space, such as files and an editor.; the desired reading width varies by task or document.. Avoid it when one panel can expand without competing with another panel for space.. Alternatives: @haze/card, @haze/scroll-area, @haze/tabs.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog