React Mosaic is a robust tiling window manager for React applications, enabling developers to create complex, customizable split-pane layouts. It provides a declarative API for defining and managing workspace configurations, supporting dynamic resizing, reordering, and adding/removing of individual panes. The package's current stable release series is 6.x (latest 6.1.1), while a significant beta release, 7.0.0-beta0, introduces a new n-ary tree structure and updated type system for React 19 compatibility. React Mosaic differentiates itself by offering deep programmatic control over the layout tree, making it ideal for applications requiring highly flexible and user-definable interfaces, such as IDEs or dashboards. It ships with comprehensive TypeScript types and supports React versions 16 through 19 as a peer dependency.
npm install react-mosaic-componentVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic multi-panel Mosaic layout with initial state, dynamic rendering of panes, and state management. Includes conditional logic for v6.x vs v7.x layout structures.
Use the `convertLegacyToNary()` utility function to automatically migrate existing binary tree layouts to the new n-ary format. Update any manually constructed layout objects to conform to the new `{ children: [...] }` structure.Ensure your project is using React 19 (or compatible versions) when upgrading to react-mosaic-component v7.x. Downgrade to a v6.x release if React 19 compatibility is not feasible.
Ensure `react-dnd` is resolved to a compatible version (e.g., `^16` for react-mosaic-component v6.x, `^14` for v5.x). Check your `yarn.lock` or `package-lock.json` and use overrides or resolutions if necessary to enforce the correct `react-dnd` version.
Review and update any custom CSS selectors or styling rules that relied on Blueprint-specific class names or DOM hierarchies within `react-mosaic-component`. Adjust any Blueprint-related imports or configurations that assumed direct integration.
Ensure `react` and `react-dom` are installed as direct dependencies in your project. If issues persist, manually install `react-dnd` with a compatible version if it's not automatically handled by the package manager.
Convert your layout definition to the new n-ary format using `{ children: [node, node, ...] }` or use the `convertLegacyToNary()` utility for automatic migration.Ensure `react-dnd` is installed and resolved to a compatible version (e.g., `^16` for `react-mosaic-component` v6.x). Wrap your root component, or at least the `Mosaic` component, with `<DndProvider manager={HTML5Backend}>`.Update your `MosaicNode` type definitions and layout objects to conform to the n-ary tree structure (`{ direction: 'row' | 'column', children: MosaicNode<T>[] }`) required by v7.x. Alternatively, ensure you are using compatible library versions.