Build a dashboard where users can drag to resize data panels and rearrange them into their preferred layout.
Create a code editor-style interface with resizable panes that users can split and reorganize freely.
Add tab containers that sit alongside split panels in a flexible layout tree for a multi-view workspace.
Build a trading terminal or analytics tool where users configure their own panel layout and it persists across sessions.
Basic two-panel setup takes about 15 lines, complex nested layouts require understanding the tree data structure.
React Mosaic is a library for web developers building applications where users need to arrange multiple panels on screen at the same time, similar to how panes work in a code editor or a trading terminal. You install it as a package in a React project and it gives you a layout where individual panels can be dragged to resize, dragged to rearrange, and split to create new ones. The whole layout updates in real time as the user moves things around. The layout is structured as a tree, meaning a single area can be split into more than two children at once, not just left and right. Tabs are treated as a proper layout type rather than an add-on, so you can have a tab container sitting alongside split panels in the same tree. The component can be either controlled, where your code manages the layout state and reacts to changes, or uncontrolled, where the component manages its own internal state and you just set a starting configuration. Drag and drop is built in using a library called react-dnd, and it supports both standard mouse interaction and touch devices. Theming is handled through CSS variables you can override, and the library ships a default visual style. It also works alongside Blueprint, a separate UI component library, though Blueprint is not required. Setting up a basic two-panel layout with a draggable divider takes around 15 lines of code based on the quick-start example in the README. The library is written in TypeScript and supports React versions 16 through 19. The project was originally created at Palantir Technologies and is released under the Apache 2.0 license. The README is short, and a separate documentation site contains the full API reference, theming options, and editable live examples.
← nomcopter on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.