React Resizable Panels’ Workspace component lets you build tabbed layouts that users can rearrange by dragging. For an IDE-style React app, it offers another option alongside docking libraries such as Dockview and FlexLayout.
Many React apps eventually need resizable panel layouts. A code editor might start with a sidebar you can resize, then get tabs, and soon users want to drag those tabs around and find the layout where they left it.
React Resizable Panels powers shadcn/ui’s Resizable component, so there’s a chance it’s already in your project. The v4.16.0 release introduced Workspace on 31 October 2026, with draggable tabs, edge splits, and maximizable tabsets. Later releases added collapsible and floating tabsets, along with a hook for popout windows; application code handles saving and restoring the layout.
I wanted to know how it compares with Dockview and FlexLayout. I built the same IDE-style layout, with a file tree, editor tabs, a preview, a terminal, and a simulated AI chat, in plain CSS, Workspace, Dockview, and FlexLayout. Then I let Playwright drag things around, time the interactions, and check which library preserves what you typed when a tab moves.
The code and recorded results are in the project repository. To follow along with that project, use Node.js v22.x and its Next.js App Router setup; Workspace’s activity mode requires React v19.2 or later.
I tested on a MacBook Air M4 with 16GB of RAM, using react-resizable-panels v4.24.1, dockview-react v8.9.1, flexlayout-react v0.11.2, Next.js v16.4.6, and React v19.3.0. The measurements below apply to those versions, with a later keyboard-support update noted in the accessibility section.
For a simple two-pane split, CSS gets you most of the way there. I put a file tree and an editor in a CSS Grid and gave the left pane resize: horizontal. You can resize it without JavaScript.
The catch is where you grab it. In the Chromium browser I tested, the handle was a tiny grip in the bottom corner of the pane. Dragging the middle of the edge did nothing: the width stayed at 260px, while dragging the corner grip took it to 413px.
Pressing Tab never focused the resize grip in this demo, so arrow keys couldn’t change the width. When I reloaded the page, a 463px pane snapped back to 260px.
That’s fine for a sidebar you resize once and forget. Moving tabs between groups, splitting panels on drop, and saving layouts require JavaScript. A library can handle those interactions for you.
Workspace describes the layout as a plain JSON model, which you pass in once as defaultModel. The following excerpt belongs in app/workspace/WorkspaceLayout.tsx and uses the shared panels and icons from the project repository:
"use client";
import { useCallback } from "react";
import {
Separator,
TabsetCollapseButton,
TabsetMaximizeButton,
Workspace,
type TabNode,
type WorkspaceModelInput,
} from "react-resizable-panels";
import { renderPanel, TABS } from "@/components/shared/panels";
import { ChevronDownIcon, MaximizeIcon } from "@/components/shared/icons";
const tab = (id: string): TabNode => ({ id, title: TABS.find((t) => t.id === id)!.title, data: {} });
const DEFAULT_MODEL: WorkspaceModelInput = {
version: 1,
root: {
type: "split", id: "root", orientation: "horizontal",
children: [
{ type: "tabset", id: "left", size: 20, minWidth: "120px", maxWidth: "500px", collapsible: true, tabs: [tab("files")] },
{
type: "split", id: "main", orientation: "vertical", size: 80,
children: [
{
type: "split", id: "top", orientation: "horizontal", size: 70,
children: [
{ type: "tabset", id: "centre", size: 70, collapsible: true, tabs: [tab("app-tsx"), tab("styles-css"), tab("settings")] },
{ type: "tabset", id: "right", size: 30, collapsible: true, tabs: [tab("preview")] },
],
},
{ type: "tabset", id: "bottom", size: 30, collapsible: true, tabs: [tab("terminal"), tab("chat")] },
],
},
],
},
};
export function WorkspaceLayout() {
const renderTabContent = useCallback((t: TabNode) => renderPanel(t.id), []);
return (
<Workspace
className="ws ws-light"
defaultModel={DEFAULT_MODEL}
hiddenTabBehavior="keep-mounted"
renderTabContent={renderTabContent}
renderSeparator={() => <Separator className="ws-separator" />}
renderTabsetToolbar={() => (
<div className="ws-toolbar">
<TabsetMaximizeButton><MaximizeIcon /></TabsetMaximizeButton>
<TabsetCollapseButton><ChevronDownIcon /></TabsetCollapseButton>
</div>
)}
onModelChanged={(model) => localStorage.setItem("layout:workspace", JSON.stringify(model))}
/>
);
}
The renderTabContent function turns a tab into a React component, and hiddenTabBehavior decides what happens to tabs you can’t see. Your choices are keep-mounted, activity, and unmount; we’ll test each in the state-preservation section.
This excerpt saves model changes to localStorage. Restoring the saved layout requires additional code; the full repository reads and normalizes the saved model after mount, then applies it with workspaceRef.current.setModel().
Workspace is headless and ships without a stylesheet. In my first screenshot, every tabset shrank to the size of its content, leaving the editor about 80px tall. To fix that, I created app/workspace/base.css, imported it from the route’s page.tsx, and added the layout rules it needed:
.ws { height: 100vh; }
.ws [data-tabset] { display: flex; flex-direction: column; height: 100%; }
.ws [data-tab-panels] { position: relative; flex: 1; min-height: 0; }
.ws [data-tab-content] { height: 100%; overflow: hidden; }
.ws-separator[aria-orientation="vertical"] { width: 5px; cursor: col-resize; }
.ws-separator[aria-orientation="horizontal"] { height: 5px; cursor: row-resize; }
Those last two lines cost me some pride. I first sized the separators with flex-basis, but the library sets an inline flex-basis: auto, so my dividers were 0px wide, and I was resizing by guesswork. Size them with width and height instead.
In the Dockview implementation, I built the initial layout with seven api.addPanel() calls inside onReady. Dockview also supports restoring serialized layouts.
FlexLayout uses a JSON model like Workspace does, but my first implementation failed during next build. Next.js refused to prerender because FlexLayout generated random IDs for my row nodes. Giving every row an explicit id fixed it.
I counted nonblank, noncomment lines in the layout files, excluding the shared panel components and separate test-instrumentation files:
| Measure | Workspace | Dockview | FlexLayout |
|---|---|---|---|
| Layout code (lines) | 119 | 84 | 64 |
| CSS for the shared design (lines) | 30 | 28 | 27 |
| Ships its own CSS file | No | Yes | Yes |
| Built-in float and popout toolbar buttons | No | No | Yes |
Workspace needed the most layout code in this implementation. Much of the extra work came from the buttons: FlexLayout provides float and popout buttons once you enable the relevant options. With Workspace, I wrote those controls myself, which took roughly 30 lines; Dockview also needed custom toolbar controls for those actions.
Being headless helped with theming. My dark shadcn-style theme for Workspace used 29 Tailwind class tokens through its classNames prop, with no additional handwritten theme CSS. The base layout stylesheet still applied, and Tailwind generated CSS for the utilities.
Dockview needed 20 lines of theme CSS, including a more specific selector to override its own theme. FlexLayout needed 25 lines of CSS variable overrides.
I measured isolated, minified esbuild bundles with React and React DOM externalized. These figures cover the library entry points and the listed library stylesheets; they exclude the demo’s custom CSS and the rest of the Next.js application:
| Library entry point | JavaScript (gzip, bytes) | CSS (gzip, bytes) |
|---|---|---|
| React Resizable Panels, panels only | 16,483 | No bundled stylesheet |
| Workspace | 45,380 | No bundled stylesheet |
| Dockview | 98,948 | 10,742 |
| FlexLayout | 51,087 | 3,897 |
The difference between the panels-only and Workspace entries was 28,897 bytes, or about 28.2KiB gzipped. That gives an estimate for a project already using shadcn/ui’s Resizable component, although the final increase depends on its imports and bundler. Dockview’s JavaScript and CSS together were about twice FlexLayout’s combined total in this test.
All three libraries passed the tested interactions, including reordering tabs, moving tabs between groups, and splitting a panel by dropping a tab on an edge. They also supported dragging a whole tabset, resizing, maximizing, closing, floating, opening popout windows, and enforcing minimum and maximum sizes.
Of the versions I tested, Workspace alone supported collapsing a regular tabset. Dockview’s collapse API applied to its special edge groups; FlexLayout supported opening and closing border panels, without an equivalent collapse action for a regular tabset.
There’s one interaction to account for: clicking the selected tab in an expanded, collapsible Workspace tabset collapses the whole tabset. That behavior arrived in v4.24.0, so make sure it fits how you expect users to navigate your app.
All three restored the layout after I added code to save it in localStorage. I moved Chat into the center, dragged a divider about 100px, and reloaded. Each library restored the tab arrangement and panel widths, with a saved model of about 1kB.
The persistence code took eight lines in Workspace, five in Dockview, and six in FlexLayout. These counts cover saving and restoring the layout model; form values and chat messages need their own persistence strategy if you want them to survive a reload.
I filled in a settings form, sent two chat messages, and scrolled the terminal. Then I moved tabs, hid them, floated one, docked it back, and popped Chat out into a new window and back.
The test tracked component instance IDs, effect runs, and the visible form and chat values. Those distinctions matter for Activity, which cleans up and restarts effects while preserving component state:
| Configuration | Form and chat state after moves and hiding within one window | Terminal scroll position | Chat state after popout and return |
|---|---|---|---|
Workspace (keep-mounted) |
Kept | Kept | Lost |
Workspace (activity) |
Kept | Kept | Lost |
Workspace (unmount) |
Lost for hidden content | Lost | Lost |
| Dockview (default) | Kept | Lost | Kept |
Dockview (always) |
Kept | Kept | Kept |
| FlexLayout (render on demand enabled or disabled) | Kept | Kept | Kept |
Within one window, Workspace preserved the form and chat state in keep-mounted and activity modes, as did both Dockview configurations and both FlexLayout configurations. Workspace’s unmount mode discarded state when content became hidden. With activity, the hidden chat’s effect-managed timer recorded zero ticks during the test.
Dockview’s default mode preserved React state but reset the terminal’s scroll position. Its default renderer removes hidden panel elements from the DOM; renderer: "always" kept the scroll position in this demo.
Workspace lost the chat state during the popout test. The new window showed zero messages, and the tab was still empty when it returned. Dockview and FlexLayout displayed all four messages, including the two simulated replies, in the popup and preserved them on return.
That follows from how this Workspace implementation opens popouts. The usePopoutWindows hook renders a separate Workspace for each window. The relevant excerpt looks like this:
const workspaceRef = useWorkspaceRef();
const popouts = usePopoutWindows({ workspaceRef });
// later, in your JSX
{popouts.render((props) => <Workspace {...props} renderTabContent={renderTabContent} />)}
The full example imports useWorkspaceRef and usePopoutWindows, attaches the ref to the main Workspace, and calls popouts.open() from its toolbar. A tab’s content mounts again when it moves into a different Workspace, so important state needs to live outside that content and remain accessible to both instances. If a separate application runs in each window, you also need to synchronize state across those windows.
Workspace’s server-rendered HTML contained all seven tab headers in my test. The panel bodies were empty by default; enabling serverRenderTabContent added the selected panels’ content too.
There’s a cost to that option: the selected content remounts once after hydration when Workspace moves it into portals. Dockview and FlexLayout returned empty layout containers in the tested implementations.
Workspace and FlexLayout both gave their dividers role="separator". I could reach them with Tab and resize with the arrow keys. Dockview’s dividers had no separator role and weren’t reachable with Tab in the tested configuration, so its built-in dividers didn’t support the same keyboard resizing workflow.
The axe scan reported one violated rule in Workspace, for close buttons nested inside tabs, and two in Dockview. FlexLayout had zero violations in that scan. These are results for the demo pages and scan configuration; they don’t establish complete accessibility compliance.
The keyboard combinations tested didn’t move tabs in any of the tested configurations. Dockview documents keyboard docking, but enabling it produced a console warning that the feature requires dockview-enterprise, consistent with its keyboard navigation documentation.
Since these tests, Workspace v4.27.0 has added keyboard tab movement. Press Ctrl+M on a focused tab, choose a destination with the arrow keys, and press Enter to move it; Escape cancels. The benchmark results here remain those of v4.24.1.
The measurements gave me little reason to choose a library on speed alone for this layout. I ran each metric 11 times against a production build in headless Chromium, discarded the first run as a warm-up, and took the median of the remaining 10.
Layout readiness was measured from navigation to the readiness marks for the four initially visible panels. The tab-move test measured from the release event to a frame after the content appeared in its destination; dropped frames were estimated from animation-frame intervals against a 60Hz frame budget:
| Metric (median) | Workspace | Dockview | FlexLayout |
|---|---|---|---|
| Time to layout readiness | 58.4ms | 60.55ms | 47.55ms |
| Tab move, release to visible content | 16.2ms | 10.8ms | 45.15ms |
| Estimated dropped frames while resizing | 0 | 0 | 1 |
FlexLayout reached the readiness marks first and took the longest to finish tab moves. Dockview had the fastest median move, with results ranging from 4.3 to 53.4ms; Workspace ranged from 13.7 to 17.9ms.
Background indexing and file-provider processes were using substantial CPU during the runs, so small differences need caution. The tab-move probe also used pointerup for Workspace and drop for the other libraries, which limits direct comparisons of those timings.
Workspace required more layout code in this demo, and the timing results were too limited to establish a useful speed advantage. Its built-in activity mode and collapsible tabsets were more useful distinctions for this project.
With activity, a hidden tab retains its state while React cleans up its effects. In my test, the hidden chat’s timer recorded zero ticks over two seconds; the tested Dockview and FlexLayout modes recorded about 20.
As the React Activity documentation explains, hidden children can still re-render at a lower priority. Timers stop when their effects clean them up, so this behavior depends on how you write the component. LogRocket’s guide to React Fiber and rendering priorities provides more background on React’s scheduling.
Collapsible tabsets are useful for a terminal or sidebar that users frequently hide. Among the versions tested, Workspace provided that behavior for regular tabsets.
Workspace also returned tab headers in the server HTML and had the smallest isolated bundle of the three docking implementations. If you already use a compatible version of React Resizable Panels through shadcn/ui, Workspace uses the same dependency. Its styling hooks let me add the dark theme with Tailwind utilities while keeping the base layout CSS.
For a sidebar with modest resizing needs, plain CSS can be enough if its browser controls suit your users. For keyboard-accessible resizable panels in a shadcn/ui app, start with ResizablePanelGroup, ResizablePanel, and ResizableHandle. The underlying React Resizable Panels primitives are Group, Panel, and Separator.
For draggable split screens without tab groups, react-mosaic is another option. I didn’t test it here; it uses React DnD for its drag-and-drop behavior.
For a new IDE-style app, Workspace is worth considering when you need collapsible tabsets or server-rendered tab headers. Its dividers support keyboard resizing, and you can style its elements through Tailwind. Plan for custom float and popout controls, plus CSS to make the layout fill the screen.
If preserving local component state through popout windows is a priority, Dockview and FlexLayout handled that in this demo. FlexLayout required the fewest lines of layout code and included the toolbar controls I needed. Dockview had the largest measured bundle, and its built-in keyboard docking requires the enterprise package.
If your app already runs on Dockview or FlexLayout, identify a specific benefit before migrating. A smaller bundle or collapsible tabsets could justify the work, depending on your requirements.
FlexLayout’s JSON model gives you a similar starting structure, though its schema and feature settings still need mapping. For the Dockview implementation in this article, migration would mean converting the addPanel() setup into a Workspace model tree.
Workspace is a practical option for a new docking interface, especially in an app that already uses React Resizable Panels. In this demo, it combined a smaller measured bundle with server-rendered tab headers and flexible styling, while requiring more setup code than Dockview or FlexLayout. Apps that depend on popout windows will need to account for remounting and preserve their state outside the tab content.
Install LogRocket via npm or script tag. LogRocket.init() must be called client-side, not
server-side
$ npm i --save logrocket
// Code:
import LogRocket from 'logrocket';
LogRocket.init('app/id');
// Add to your HTML:
<script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script>
<script>window.LogRocket && window.LogRocket.init('app/id');</script>

Learn to build a Python-based PDF search app with Typesense, embeddings, and semantic retrieval.

Explore modern CSS masonry layouts with display: grid-lanes, interactive demos, browser support, and CSS column fallbacks.

Build a Claude Code harness with saved plans, tool hooks, and milestone checks for frontend work that spans sessions.

Chema Roldán, CTO at Genially, shares how his teams have stopped watching sessions manually thanks to the LogRocket MCP.
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now