MCPcopy Create free account
hub / github.com/bvaughn/react-resizable-panels

github.com/bvaughn/react-resizable-panels

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.24.1 ↗ · + Follow · compare 9 versions
1,209 symbols 4,046 edges 742 files 1 documented · 0% ● updated 48d ago4.14.2 · 2026-10-02★ 5,391

Browse by type

⨍ Functions 1,182◇ Types & classes 27
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

react-resizable-panels logo

react-resizable-panels: React components for resizable layouts: panel groups, grids, and workspaces of tabsets that users can rearrange by dragging tabs.

Support

If you like this project there are several ways to support it:

Installation

Begin by installing the library from NPM:

npm install react-resizable-panels

TypeScript types

TypeScript definitions are included within the published dist folder

FAQs

Frequently asked questions can be found here.

Documentation

Documentation for this project is available at react-resizable-panels.vercel.app.

Components

Cell

A Cell occupies one or more tracks (columns and rows) within a Grid. Cells are resized along with the tracks they occupy.

Cell elements always include the following attributes:




ℹ️ Test id can be used to narrow selection when unit testing.

⚠️ Cell elements must be direct DOM children of their parent Grid elements.

Required props

Name Description
column Index of the (first) column this cell occupies.
row Index of the (first) row this cell occupies.

Optional props

Name Description
className CSS class name.
id 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).
style CSS properties. ⚠️ Grid placement properties are managed by the Cell and cannot be overridden.
children Cell contents.
columnSpan Number of columns this cell spans; defaults to 1.
elementRef Ref attached to the root HTMLDivElement.
rowSpan Number of rows this cell spans; defaults to 1.

Grid

A Grid arranges resizable Cells in two dimensions. Columns can be resized horizontally and rows can be resized vertically; dragging the point where a column boundary and a row boundary intersect resizes both.

Size constraints (e.g. min/max size, collapsible) are specified per track (column or row), using the same format as Panel props.

Cells can span multiple columns and/or rows. Track boundaries cannot be resized alongside of a cell that spans across them.

Grid elements always include the following attributes:




ℹ️ Test id can be used to narrow selection when unit testing.

Required props

Name Description
columns Grid columns; either the number of columns or an array of size constraints (one per column).
rows Grid rows; either the number of rows or an array of size constraints (one per row).

Optional props

Name Description
className CSS class name.
id 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).
style CSS properties. ⚠️ Grid template and display properties are managed by the Grid and cannot be overridden.
children Cell and Gridline components that comprise this grid. ⚠️ Cell and Gridline elements must be direct DOM children of their parent Grid element.
defaultLayout Default layout for either or both of the Grid's axes. ℹ️ This value allows layouts to be remembered between page reloads.
disableCursor This library sets custom mouse cursor styles to indicate drag state. Use this prop to disable that behavior for this grid.
disabled Disable resize functionality.
elementRef Ref attached to the root HTMLDivElement.
gridRef 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 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 callback is not called until the pointer has been released. This callback is recommended for saving layouts to storage.
resizeTargetMinimumSize Minimum 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.

Gridline

Resizes the columns (or rows) of a Grid.

For example:

// Rendered between columns 0 and 1 and spans all rows
<Gridline type="column" column={1} />
// Rendered between rows 0 and 1 and spans all columns
<Gridline type="row" row={1} />
// Rendered between columns 0 and 1 alongside of row 2 only
<Gridline type="column" column={1} row={2} rowSpan={1} />

A gridline should not be rendered alongside of a Cell that spans across its boundary (this includes disabled gridlines; in development builds, an error will be logged to the console); render multiple gridlines along the same boundary instead (e.g. before and after the spanning Cell).

ℹ️ Once a boundary contains a gridline, it can only be resized using gridlines; the parts of the boundary that aren't alongside of a gridline can't be dragged.

Where column and row gridlines intersect, dragging resizes both axes.

Gridlines are not required but they are recommended as they improve keyboard accessibility.

Gridline elements always include the following attributes:




ℹ️ Column gridlines are vertical (aria-orientation="vertical") and row gridlines are horizontal (aria-orientation="horizontal").

ℹ️ In addition to the attributes shown above, gridlines also render all required WAI-ARIA properties.

⚠️ Gridline elements must be direct DOM children of their parent Grid elements.

ℹ️ Gridlines rendered by another component (rather than directly within the Grid) aren't detected until they mount, so server-rendered layouts may shift slightly during hydration.

Required props

Name Description
type 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.

Optional props

Name Description
children Gridline contents (e.g. a drag handle icon).
className CSS class name. ℹ️ Use the data-separator attribute for custom hover and active styles
disabled 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.
elementRef Ref attached to the root HTMLDivElement.
style CSS properties. ⚠️ Grid placement properties are managed by the gridline and cannot be overridden.
column 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.
row 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.
rowSpan Number of rows a column gridline spans; defaults to all rows (starting from row). ℹ️ Gridlines can span a subset of rows in order to avoid cells that span across the boundary they sit on; multiple gridlines can be rendered along the same boundary (e.g. above and below a spanning cell).
columnSpan Number of columns a row gridline spans; defaults to all columns (starting from column). ℹ️ Gridlines can span a subset of columns in order to avoid cells that span across the boundary they sit on; multiple gridlines can be rendered along the same boundary (e.g. before and after a spanning cell).

Group

A Group wraps a set of resizable Panel components. Group content can be resized horizontally or vertically.

Group elements always include the following attributes:




ℹ️ Test id can be used to narrow selection when unit testing.

Required props

None

Optional props

Name Description
className CSS class name.
id 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).
style CSS properties. ⚠️ The default inline styles cannot be overridden, except for overflow.
children Panel and Separator components that comprise this group.
defaultLayout 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.
disableCursor 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.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 1,173
Interface 21
Method 9
Class 6

Languages

TypeScript100%

Modules by API surface

lib/workspace/components/Workspace.test.tsx66 symbols
integrations/tests/tests/workspace.spec.tsx43 symbols
lib/workspace/hooks/useTabDrag.ts23 symbols
src/components/workspace/WorkspaceDemo.tsx20 symbols
src/components/vs-code-workspace/VSCodeWorkspace.tsx20 symbols
lib/grid/components/Grid.tsx17 symbols
integrations/tests/src/utils/serializer/encode.ts17 symbols
integrations/tests/src/utils/serializer/decode.ts17 symbols
integrations/tests/src/utils/serializer/types.ts15 symbols
lib/workspace/components/FloatingTabsets.test.tsx14 symbols
lib/grid/components/Grid.test.tsx13 symbols
lib/global/utils/getImperativeItemMethods.ts13 symbols

Dependencies from manifests, versioned

@csstools/postcss-oklab-function4.0.11 · 1×
@eslint/js9.30.1 · 1×
@headlessui/react2.2.4 · 1×
@headlessui/tailwindcss0.2.2 · 1×
@heroicons/react2.2.0 · 1×
@playwright/test1 · 1×
@tailwindcss/vite4.1.11 · 1×
@tailwindplus/elements1.0.5 · 1×
@testing-library/react16.3.0 · 1×

For agents

$ claude mcp add react-resizable-panels \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page