Components · Layout
Resizable
Columns or rows whose split people drag, with the drag handle sitting on the seam between them, or in the gap between cards that have no seam.
import { Resizable } from "@botiverse/raft-ui";Resizable lets people drag the boundary between two regions to change how much room each one gets: the sidebar and the main area, or a conversation and its thread. The seam between the two columns is the only line, and the drag handle sits on it (Built from existing parts). Cards laid out in a panel have no seam, so their handle is the gap between them (The gap handle).
When to use
Anatomy
ResizableGroup: the container.orientation="horizontal"(the default) puts its panels side by side;orientation="vertical"stacks them. Required.ResizablePanel: one region, with its default, minimum and maximum size. At least 2.ResizableHandle: the drag handle between two panels. Required between every adjacent pair: a group without handles is plain layout.
The panels draw no surface, edge or padding. The region inside each panel draws its own, including the one seam between the two (Page structure).
Variants
The gap handle
Cards laid out in a panel have no seam to drag: each card draws its own edge, and the 12px between it and its neighbor is empty. So the handle is the gap itself: the 12px beside the cards and the 12px between two stacked cards. A line drawn in the gap would be the seam the cards were laid out without, so the handle shows a short bar instead, which reads as a grip, not as an edge.
- The bar follows the pointer because a gap has no line: the bar is the only thing that marks where the hand is, and a bar fixed in the middle of a long edge looks unrelated to the pointer. A touch has no hover to follow, so there the bar stays in the middle.
- The hit area is the whole 12px gap along the card, 24px under a coarse pointer, so it takes no room from the cards. A double click puts the size back to its default.
- Where two gaps cross, the 12px square where they meet (24px by touch) drags both at once with the move cursor, as at a grid's crossing, and hovering or dragging it lights both bars where they meet: the one along the crossing gap at the pointer, the other at its end against the corner. A double click on it resets both. The square is for the pointer only: each gap keeps its own keyboard handle, a focusable
separatorlike a seam's. ResizableHandledraws only the seam handle today.
States
These are the states of the handle on a seam; the gap handle's are in The gap handle.
Behavior
- The handle is 12px wide and lies over the start of the panel after the boundary (to its right, or below it), so it takes no room from either panel; its line is still drawn on the seam. Under a coarse pointer (a finger on a tablet) it is 24px wide.
- Why after the boundary, not centered on it: a panel's scrollbar runs along its end edge, the seam's other side. Centered, the handle covered the scrollbar's last 6px, where the thumb is, and took its drag: on the Raft app's Activity list the thumb couldn't be dragged (InNOut, 2026-11-09, #proj-raft-ui:21bae128). The start of the panel after a seam never has a scrollbar.
- A double click on the handle puts the column back to its default width.
- Use the widths in Spacing for the default, minimum and maximum: every column has its own range, and the sidebar keeps one width on every page (Resizing columns).
- Pass
groupResizeBehavior="preserve-pixel-size"on the sidebar's panel, so the sidebar keeps its width when the window changes and the main area takes up the difference. - In a conversation's row every seam trades width between its two neighbours, and once the shrinking one is down to 160px the drag goes on taking from the next column further out on that side (the cascade); a column's content keeps its own minimum and is clipped under it. What a release shows is what is saved (The channel's side columns).
- Below 768px there are no side-by-side columns to resize in Raft Chat; a server's public page keeps its columns from 640px (Responsive layout).
Dragging past the end
A drag that reaches the end of the sidebar's range and keeps going changes the layout's state instead of stopping: the sidebar snaps to its next state, and that jump is how people know they went past the end (stdrc, 2026-10-23).
- The sidebar collapses. Drag it to its minimum and 40px further toward the edge: it collapses at once, while the drag is still held.
- Nothing else snaps. A seam in a conversation's row doesn't stop at a minimum: it carries on into the next column, each down to 160px (Behavior). A thread is expanded by the Expand in its head, as every column is, not by a drag past the end (Panel; stdrc, 2026-11-03 and 2026-11-04, #proj-raft-ui:#189).
- It switches during the drag, not on release. Dragging back across the line, still held, undoes it; releasing keeps whichever state is showing. A preview that only switches on release has no jump, and the jump is the point: VS Code's sidebar and macOS split views snap the same way.
- 40px, not a touch. The extra 40px keeps a drag that just reaches the end from snapping by accident.
- The width comes back. The width the sidebar had before it snapped is remembered, and expanding the sidebar brings it back. A double click on the handle still resets to the default width.
- The keyboard reaches it. Enter on the handle collapses or restores the sidebar, as for any collapsible panel (Accessibility), so the state doesn't need a pointer.
Accessibility
- Resizable wraps react-resizable-panels. Each
ResizableHandleis a focusableseparatorwitharia-valuenow,aria-valuemin,aria-valuemaxandaria-controls. - Keyboard: the arrow keys along the group's orientation resize in small steps, Home and End go to the minimum and the maximum, Enter collapses or restores a collapsible panel, and F6 moves to the next handle.
- Give every handle an
aria-labelthat says what it resizes: "Resize sidebar".
Rules
- Use Resizable only for splits people adjust. Don't wrap fixed layouts in a group in case they might be resized later.
- Don't draw a line on a seam's handle or a second edge on the panels: the seam of the region is the only line. A gap handle draws only its short bar, and only on hover, drag and focus.
API
ResizableGroup, ResizableHandle, ResizablePanel
Takes the attributes of its element.
Related
Changes
- 0.25.0 · Design SystemThe gap handle's bar follows the pointer: on hover, the 56 × 4px bar in a gap between side cards is centered on the pointer along the gap, kept half a bar inside each end, with round ends; while dragging it stays where the drag started, and with keyboard focus it sits in the middle. Where two gaps cross, the crossing gap's bar lights at the pointer and the other at its end against the corner.
ResizableHandlestill draws only the seam handle; products draw the gap handle themselves. - 0.0.21 · AddedAdded generic
ResizableGroup,ResizableHandle, andResizablePanelprimitives for resizable panel layouts.