Put a ResizableHandle between two ResizablePanel parts in a group.
mail-layout.tsx
ResizablePanelGroup
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | CSS class name. |
| id | string | — | 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 | CSSProperties | — | CSS properties. ⚠️ The default inline styles cannot be overridden, except for overflow. |
| children | ReactNode | — | Panel and Separator components that comprise this group. |
| default | Layout | — | 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. |
| disable | boolean | — | 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. |
| disabled | boolean | false | Disable resize functionality. |
| element | Ref<HTMLDivElement | null> | — | Ref attached to the root HTMLDivElement. |
| group | Ref<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. |
| on | — | 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. | |
| on | — | 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. | |
| resize | "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. |
| resize | { coarse: number; fine: number; } | HIT_TARGET | Minimum 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>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | CSS class name. ⚠️ Class is applied to nested HTMLDivElement to avoid styles that interfere with Flex layout. |
| id | string | — | 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). |
| style | CSSProperties | — | CSS properties. ⚠️ The default inline styles cannot be overridden, except for overflow. |
| collapsed | string | number | "0%" | Panel size when collapsed; defaults to 0%. |
| collapsed | string | 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 |
| collapsible | boolean | false | This panel can be collapsed. ℹ️ A collapsible panel will collapse when its size is less than the specified minSize |
| default | string | 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. |
| disabled | boolean | — | When disabled, a panel cannot be resized either directly or indirectly (by resizing another panel). |
| element | Ref<HTMLDivElement | null> | — | Ref attached to the root HTMLDivElement. |
| group | "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. |
| max | string | 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 |
| min | string | 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 |
| on | — | Called when panel sizes change. | |
| panel | Ref<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>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | CSS class name. ℹ️ Use the data-separator attribute for custom _hover_ and _active_ styles ⚠️ The following properties cannot be overridden: flex-grow, flex-shrink |
| id | string | — | 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). |
| style | CSSProperties | — | CSS properties. ℹ️ Use the data-separator attribute for custom _hover_ and _active_ styles ⚠️ The following properties cannot be overridden: flex-grow, flex-shrink |
| disabled | boolean | — | 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. |
| disable | boolean | — | When true, double-clicking this Separator will not reset its Panel to its default size. |
| element | Ref<HTMLDivElement> | — | Ref attached to the root HTMLDivElement. |
| preview | ReactNode | — | Overrides the Group default preview for this Separator when resizePreviewMode is "separator". |
| with | boolean | — | Shows a grip pill on the line. |
| value | defaultValueText | The 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>. |
ResizableGrid
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | CSS class name. |
| id | string | — | 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 | CSSProperties | — | CSS properties. ⚠️ Grid template and display properties are managed by the Grid and cannot be overridden. |
| children | ReactNode | — | Cell and Gridline components that comprise this grid. ⚠️ Cell and Gridline elements must be direct DOM children of their parent Grid element. |
| columns | number | GridTrackProps[] | — | Grid columns; either the number of columns or an array of size constraints (one per column). |
| default | Partial<GridLayout> | — | Default layout for either or both of the Grid's axes. ℹ️ This value allows layouts to be remembered between page reloads. |
| disable | boolean | — | This library sets custom mouse cursor styles to indicate drag state. Use this prop to disable that behavior for this grid. |
| disabled | boolean | false | Disable resize functionality. |
| element | Ref<HTMLDivElement | null> | — | Ref attached to the root HTMLDivElement. |
| grid | Ref<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. |
| on | — | 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. | |
| on | — | 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. | |
| resize | { coarse: number; fine: number; } | HIT_TARGET | 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. |
| rows | number | 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>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | CSS class name. |
| id | string | — | 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 | CSSProperties | — | CSS properties. ⚠️ Grid placement properties are managed by the Cell and cannot be overridden. |
| children | ReactNode | — | Cell contents. |
| column | number | — | Index of the (first) column this cell occupies. |
| column | number | 1 | Number of columns this cell spans; defaults to 1. |
| element | Ref<HTMLDivElement | null> | — | Ref attached to the root HTMLDivElement. |
| row | number | — | Index of the (first) row this cell occupies. |
| row | number | 1 | Number of rows this cell spans; defaults to 1. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>. |
ResizableGridline
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Gridline contents (e.g. a drag handle icon). |
| class | string | — | CSS class name. ℹ️ Use the data-separator attribute for custom _hover_ and _active_ styles |
| disabled | boolean | — | 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. |
| element | Ref<HTMLDivElement> | — | Ref attached to the root HTMLDivElement. |
| style | CSSProperties | — | CSS properties. ⚠️ Grid placement properties are managed by the gridline and cannot be overridden. |
| type | "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. |
| column | number | — | 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 | number | — | 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. |
| with | boolean | — | Shows a grip pill on the line. |
| value | defaultValueText | The spoken size (aria-valuetext) from the aria-valuenow percent of the track before the line. Translate it. Default: "40%". | |
| aria-label | string | — | Names what the line sizes ("Resize the revenue column"). |
| aria-labelledby | string | — | The id of a heading that names what the line sizes. |
| ← → | Moves a vertical handle. Up and Down move a horizontal one. |
|---|---|
| Enter | Folds or opens a collapsible panel. |
| F6 | Moves between the handles. |





