Skip to content

Resizable

Free

Panels and grids of cells that people size with a drag or the keyboard. The lines show hover, drag, and focus, with a 44px touch target.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Put a ResizableHandle between two ResizablePanel parts in a group.

mail-layout.tsx

ResizablePanelGroup

<div>
PropTypeDefaultDescription
classNamestring—CSS class name.
idstring—Uniquely identifies this group within an application. Falls back to useId when not provided. ℹ️ This value will also be assigned to the id and data-testid attributes; (an explicit data-testid prop will take precedence).
styleCSSProperties—CSS properties. ⚠️ The default inline styles cannot be overridden, except for overflow.
childrenReactNode—Panel and Separator components that comprise this group.
defaultLayoutLayout—Default layout for the Group. ℹ️ This value allows layouts to be remembered between page reloads. ⚠️ Slight layout shift may occur when server-rendering panels with percentage-based default sizes. Refer to the documentation for suggestions on how to minimize the impact of this.
disableCursorboolean—This library sets custom mouse cursor styles to indicate drag state. Use this prop to disable that behavior for Panels and Separators in this group.
disabledbooleanfalseDisable resize functionality.
elementRefRef<HTMLDivElement | null>—Ref attached to the root HTMLDivElement.
groupRefRef<GroupImperativeHandle | null>—Exposes the following imperative API: - getLayout: Layout - setLayout(layout: Layout): Layout ℹ️ The useGroupRef and useGroupCallbackRef hooks are exported for convenience use in TypeScript projects.
onLayoutChange—Called when the Group's layout is changing. ⚠️ For layout changes caused by pointer events, this method is called each time the pointer is moved. For most cases, it is recommended to use the onLayoutChanged callback instead.
onLayoutChanged—Called after the Group's layout has been changed. ℹ️ For layout changes caused by pointer events, this method is not called until the pointer has been released. This method is recommended when saving layouts to some storage api. ℹ️ The second argument contains meta information about the layout change. The isUserInteraction attribute signals whether the resize was caused by direct user input. It is true for resizes caused by pointer or keyboard input and false for other triggers (e.g. imperative API calls, initial mount, etc.) The requestedLayout attribute is the layout before constraints were applied for the current Group size; prefer it when persisting layouts.
resizePreviewMode"panel""separator""panel"Controls whether pointer dragging updates Panel sizes immediately, or renders overlay separator previews until the pointer is released. Defaults to "panel" (immediate resizing); "separator" defers resizing until release. Customize previews using the SeparatorOverlay component.
resizeTargetMinimumSize{ coarse: number; fine: number; }HIT_TARGETMinimum size of the resizable hit target area (either Separator or Panel edge). This threshold ensures targets are large enough to avoid mis-clicks. - Coarse inputs (typically a finger on a touchscreen) have reduced accuracy; to ensure accessibility and ease of use, hit targets should be larger to prevent mis-clicks. - Fine inputs (typically a mouse) can be smaller ℹ️ Apple interface guidelines suggest 20pt (27px) on desktops and 28pt (37px) for touch devices. In practice this seems to be much larger than many of their own applications use though.
orientation"horizontal""vertical""horizontal"Specifies the resizable orientation ("horizontal" or "vertical"); defaults to "horizontal"
...props<div> attributes—Every other attribute goes to the <div>.

ResizablePanel

<div>
PropTypeDefaultDescription
classNamestring—CSS class name. ⚠️ Class is applied to nested HTMLDivElement to avoid styles that interfere with Flex layout.
idstring—Uniquely identifies this panel within the parent group. Falls back to useId when not provided. ℹ️ This prop is used to associate persisted group layouts with the original panel. ℹ️ This value will also be assigned to the id and data-testid attributes; (an explicit data-testid prop will take precedence).
styleCSSProperties—CSS properties. ⚠️ The default inline styles cannot be overridden, except for overflow.
collapsedSizestring | number"0%"Panel size when collapsed; defaults to 0%.
collapsedThresholdstring | number—Distance a collapsible panel must be resized past its minSize to collapse, or past its collapsedSize to expand. Defaults to half the distance between collapsedSize and minSize. For example if a panel declares collapsedSize="5%", collapsedThreshold="5%", and minSize="25%", it will collapse when resized below 20% and expand when resized above 10%. ℹ️ Interpretation rules: - Numbers are interpreted as pixels (e.g. minSize={200} is 200 pixels) - Strings without explicit units are interpreted as percentage (e.g. minSize="50" is 50 percent) - Use explicit units (e.g. "px", "%", "em", "rem", "vh", or "vw") to change interpretation
collapsiblebooleanfalseThis panel can be collapsed. ℹ️ A collapsible panel will collapse when its size is less than the specified minSize
defaultSizestring | number—Default size of Panel within its parent group; default is auto-assigned based on the total number of Panels. ℹ️ Interpretation rules: - Numbers are interpreted as pixels (e.g. defaultSize={200} is 200 pixels) - Strings without explicit units are interpreted as percentage (e.g. defaultSize="50" is 50 percent) - Use explicit units (e.g. "px", "%", "em", "rem", "vh", or "vw") to change interpretation ⚠️ Percentage based sizes may cause slight layout shift when server-rendering. For more information see the documentation.
disabledboolean—When disabled, a panel cannot be resized either directly or indirectly (by resizing another panel).
elementRefRef<HTMLDivElement | null>—Ref attached to the root HTMLDivElement.
groupResizeBehavior"preserve-pixel-size""preserve-relative-size""preserve-relative-size"How should this Panel behave if the parent Group is resized? Defaults to preserve-relative-size. - preserve-relative-size: Retain the current relative size (as a percentage of the Group) - preserve-pixel-size: Retain its current size (in pixels) ℹ️ Panel min/max size constraints may impact this behavior. ⚠️ A Group must contain at least one Panel with preserve-relative-size resize behavior.
maxSizestring | number"100%"Maximum size of Panel within its parent group; defaults to "100%". ℹ️ Interpretation rules: - Numbers are interpreted as pixels (e.g. maxSize={200} is 200 pixels) - Strings without explicit units are interpreted as percentage (e.g. maxSize="50" is 50 percent) - Use explicit units (e.g. "px", "%", "em", "rem", "vh", or "vw") to change interpretation
minSizestring | number"0%"Minimum size of Panel within its parent group; defaults to 0%. ℹ️ Interpretation rules: - Numbers are interpreted as pixels (e.g. minSize={200} is 200 pixels) - Strings without explicit units are interpreted as percentage (e.g. minSize="50" is 50 percent) - Use explicit units (e.g. "px", "%", "em", "rem", "vh", or "vw") to change interpretation
onResize—Called when panel sizes change.
panelRefRef<PanelImperativeHandle | null>—Exposes the following imperative API: - collapse: void - expand: void - getSize: PanelSize - isCollapsed: boolean - resize(size: number | string): void ℹ️ The usePanelRef and usePanelCallbackRef hooks are exported for convenience use in TypeScript projects.
...props<div> attributes—Every other attribute goes to the <div>.

ResizableHandle

<div>
PropTypeDefaultDescription
classNamestring—CSS class name. ℹ️ Use the data-separator attribute for custom _hover_ and _active_ styles ⚠️ The following properties cannot be overridden: flex-grow, flex-shrink
idstring—Uniquely identifies the separator within the parent group. Falls back to useId when not provided. ℹ️ This value will also be assigned to the id and data-testid attributes; (an explicit data-testid prop will take precedence).
styleCSSProperties—CSS properties. ℹ️ Use the data-separator attribute for custom _hover_ and _active_ styles ⚠️ The following properties cannot be overridden: flex-grow, flex-shrink
disabledboolean—When disabled, the separator cannot be used to resize its neighboring panels. ℹ️ The panels may still be resized indirectly (while other panels are being resized). To prevent a panel from being resized at all, it needs to also be disabled.
disableDoubleClickboolean—When true, double-clicking this Separator will not reset its Panel to its default size.
elementRefRef<HTMLDivElement>—Ref attached to the root HTMLDivElement.
previewReactNode—Overrides the Group default preview for this Separator when resizePreviewMode is "separator".
withHandleboolean—Shows a grip pill on the line.
valueTextdefaultValueTextThe spoken size (aria-valuetext) from the aria-valuenow percent. Translate it. Default: "40%". An aria-valuetext prop wins.
...props<div> attributes—Every other attribute goes to the <div>.

ResizableSeparatorOverlay

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>.

ResizableGrid

<div>
PropTypeDefaultDescription
classNamestring—CSS class name.
idstring—Uniquely identifies this grid within an application. Falls back to useId when not provided. ℹ️ This value will also be assigned to the id and data-testid attributes; (an explicit data-testid prop will take precedence).
styleCSSProperties—CSS properties. ⚠️ Grid template and display properties are managed by the Grid and cannot be overridden.
childrenReactNode—Cell and Gridline components that comprise this grid. ⚠️ Cell and Gridline elements must be direct DOM children of their parent Grid element.
columnsRequirednumber | GridTrackProps[]—Grid columns; either the number of columns or an array of size constraints (one per column).
defaultLayoutPartial<GridLayout>—Default layout for either or both of the Grid's axes. ℹ️ This value allows layouts to be remembered between page reloads.
disableCursorboolean—This library sets custom mouse cursor styles to indicate drag state. Use this prop to disable that behavior for this grid.
disabledbooleanfalseDisable resize functionality.
elementRefRef<HTMLDivElement | null>—Ref attached to the root HTMLDivElement.
gridRefRef<GridImperativeHandle | null>—Exposes the following imperative API: - getLayout: GridLayout - getTrackById(axis: "column" | "row", id: string | number): GridTrackImperativeHandle - getTrackByIndex(axis: "column" | "row", index: number): GridTrackImperativeHandle - setLayout(layout: Partial<GridLayout>): GridLayout ℹ️ The useGridRef and useGridCallbackRef hooks are exported for convenience use in TypeScript projects.
onLayoutChange—Called when the Grid's layout is changing. ⚠️ For layout changes caused by pointer events, this method is called each time the pointer is moved. For most cases, it is recommended to use the onLayoutChanged callback instead.
onLayoutChanged—Called after the Grid's layout has been changed. ℹ️ For layout changes caused by pointer events, this method is not called until the pointer has been released. This method is recommended when saving layouts to some storage api.
resizeTargetMinimumSize{ coarse: number; fine: number; }HIT_TARGETMinimum size of the resizable hit target area (either a Gridline or a Cell edge). This threshold ensures targets are large enough to avoid mis-clicks. ℹ️ Refer to the Group prop of the same name for more information.
rowsRequirednumber | GridTrackProps[]—Grid rows; either the number of rows or an array of size constraints (one per row).
...props<div> attributes—Every other attribute goes to the <div>.

ResizableCell

<div>
PropTypeDefaultDescription
classNamestring—CSS class name.
idstring—Uniquely identifies this cell within the parent grid. Falls back to useId when not provided. ℹ️ This value will also be assigned to the id and data-testid attributes; (an explicit data-testid prop will take precedence).
styleCSSProperties—CSS properties. ⚠️ Grid placement properties are managed by the Cell and cannot be overridden.
childrenReactNode—Cell contents.
columnRequirednumber—Index of the (first) column this cell occupies.
columnSpannumber1Number of columns this cell spans; defaults to 1.
elementRefRef<HTMLDivElement | null>—Ref attached to the root HTMLDivElement.
rowRequirednumber—Index of the (first) row this cell occupies.
rowSpannumber1Number of rows this cell spans; defaults to 1.
...props<div> attributes—Every other attribute goes to the <div>.

ResizableGridline

PropTypeDefaultDescription
childrenReactNode—Gridline contents (e.g. a drag handle icon).
classNamestring—CSS class name. ℹ️ Use the data-separator attribute for custom _hover_ and _active_ styles
disabledboolean—When disabled, the gridline cannot be used to resize its neighboring tracks. ℹ️ The tracks may still be resized indirectly (e.g. by an intersecting gridline or another boundary). To prevent a track from being resized at all, it needs to also be disabled.
elementRefRef<HTMLDivElement>—Ref attached to the root HTMLDivElement.
styleCSSProperties—CSS properties. ⚠️ Grid placement properties are managed by the gridline and cannot be overridden.
typeRequired"column""row"—Column gridlines are vertical; they resize the columns on either side of them. Row gridlines are horizontal; they resize the rows on either side of them.
columnnumber—When type is "column", the gridline is rendered along the leading (left) edge of this column (between it and the previous column); must be greater than 0 and less than the number of columns. When type is "row", index of the first column the gridline is rendered alongside of; defaults to 0.
rownumber—When type is "column", index of the first row the gridline is rendered alongside of; defaults to 0. When type is "row", the gridline is rendered along the leading (top) edge of this row (between it and the previous row); must be greater than 0 and less than the number of rows.
withHandleboolean—Shows a grip pill on the line.
valueTextdefaultValueTextThe spoken size (aria-valuetext) from the aria-valuenow percent of the track before the line. Translate it. Default: "40%".
aria-labelstring—Names what the line sizes ("Resize the revenue column").
aria-labelledbystring—The id of a heading that names what the line sizes.
  • Use it for panes that the user sizes, such as a list next to a reader.
  • Give each panel a minSize, so no panel shrinks to 0.
  • Use ResizableGrid when columns and rows must size together.
  • For a side menu of an app, use a Sidebar.
  • For content that only scrolls, use a Scroll Area.
← →Moves a vertical handle. Up and Down move a horizontal one.
EnterFolds or opens a collapsible panel.
F6Moves between the handles.

Each handle is a separator with its size as a value; valueText can say it in words.

On touch, each handle has a 44px target.

  1. AddedResizable.
Open the release