Skip to content
Back to search

react-mosaic

A React tiling window manager

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nomcopter--react-mosaic/badge.svg)](/listings/nomcopter--react-mosaic)

HTML

<a href="/listings/nomcopter--react-mosaic"><img src="/api/listings/nomcopter--react-mosaic/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npm install react-mosaic-component react react-dom

Import the stylesheet in your app's entry point:

import 'react-mosaic-component/react-mosaic-component.css';

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 124 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![NPM Version](https://img.shields.io/npm/v/react-mosaic-component.svg)](https://www.npmjs.com/package/react-mosaic-component)
  2. [![React](https://img.shields.io/badge/React-16%20%7C%2017%20%7C%2018%20%7C%2019-blue.svg)](https://reactjs.org/)
  3. [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)
  4. <p align="center">
  5. <img alt="React Mosaic" src="./apps/website/static/img/favicon.svg" width="64px">
  6. </p>
  7. **react-mosaic** is a React tiling window manager. It gives you a drag-to-resize, drag-to-rearrange layout of panels that users can freely rearrange — inspired by IDE window management and i3-style tiling.
  8. **📖 [Documentation](https://nomcopter.github.io/react-mosaic/) · 🎮 [Demo](https://nomcopter.github.io/react-mosaic/demo) · 📚 [API reference](https://nomcopter.github.io/react-mosaic/docs/api) · 🚚 [Migration from v6](https://nomcopter.github.io/react-mosaic/docs/migration/from-v6)**
  9. [![screencast demo](./screencast.gif)](./screencast.gif)
  10. ## Install
  11. ```bash
  12. npm install react-mosaic-component react react-dom
  13. ```
  14. Import the stylesheet in your app's entry point:
  15. ```tsx
  16. import 'react-mosaic-component/react-mosaic-component.css';
  17. ```
  18. ## Quick start
  19. ```tsx
  20. import { Mosaic, MosaicWindow } from 'react-mosaic-component';
  21. import 'react-mosaic-component/react-mosaic-component.css';
  22. export function App() {
  23. return (
  24. <div style={{ height: '100vh' }}>
  25. <Mosaic<string>
  26. renderTile={(id, path) => (
  27. <MosaicWindow<string> path={path} title={`Panel ${id}`}>
  28. <div style={{ padding: 20 }}>Contents of {id}</div>
  29. </MosaicWindow>
  30. )}
  31. initialValue={{
  32. type: 'split',
  33. direction: 'row',
  34. children: ['a', 'b'],
  35. }}
  36. />
  37. </div>
  38. );
  39. }
  40. ```
  41. To render it, mount `App` from your entry file as usual:
  42. ```tsx
  43. // main.tsx
  44. import { StrictMode } from 'react';
  45. import { createRoot } from 'react-dom/client';
  46. import { App } from './App';
  47. createRoot(document.getElementById('root')!).render(
  48. <StrictMode>
  49. <App />
  50. </StrictMode>,
  51. );
  52. ```
  53. The wrapper `div` needs a real height; `Mosaic` fills its parent, so a parent
  54. with no height gives you an empty page.
  55. That's a two-panel layout with a draggable divider, drag handles on each window title bar, and default toolbar buttons — in 15 lines.
  56. For live editable examples, the n-ary tree model, custom toolbars, tabs, theming, and the full API reference, see the **[documentation site](https://nomcopter.github.io/react-mosaic/)**.
  57. ## Features
  58. - **N-ary tree layouts.** A single split can hold any number of children, not just two.
  59. - **Tabs as first-class citizens.** Tab containers are a node type, not a bolted-on convention.
  60. - **Controlled or uncontrolled.** Pass `value` + `onChange` to manage the tree yourself, or `initialValue` to let the component own it.
  61. - **Drag-and-drop.** Built on `react-dnd` with HTML5 and touch backends.
  62. - **Theming.** Works with or without Blueprint; ships a default CSS theme plus CSS variables you can override.
  63. - **Zero-config migration.** Legacy v6 binary trees are auto-converted at render time. `convertLegacyToNary` is available for explicit upgrades.
  64. ## Using with AI coding agents
  65. The package ships an [Agent Skill](./skills/react-mosaic/SKILL.md) with the v7
  66. API, the tree model and the common mistakes (like writing the old v6
  67. `first`/`second` trees). It works with Claude Code, Codex, Cursor, GitHub
  68. Copilot, Gemini CLI and other agents that support skills:
  69. ```bash
  70. npx skills add nomcopter/react-mosaic
  71. ```
  72. Or point your agent at
  73. `node_modules/react-mosaic-component/skills/react-mosaic/SKILL.md`, e.g. from
  74. your `AGENTS.md` or `CLAUDE.md`. For chat assistants, the docs are also
  75. available as [llms.txt](https://nomcopter.github.io/react-mosaic/llms.txt) and
  76. [llms-full.txt](https://nomcopter.github.io/react-mosaic/llms-full.txt).
  77. ## Browser support
  78. Current versions of Chrome, Edge, Firefox and Safari, on desktop and mobile
  79. (touch drag and drop is built in). Internet Explorer is not supported. The
  80. package is published as modern JavaScript, so if you target older browsers,
  81. let your bundler transpile `react-mosaic-component` too.
  82. ## Contributing
  83. Contributions are welcome:
  84. - Clone and install: `npm install`
  85. - Start the docs site (hot-reloads the demo and live code blocks): `npm start`
  86. - Build the library: `npm run build:lib`
  87. - Run tests: `npm test`
  88. - Lint: `npm run lint`
  89. Issues and pull requests: [github.com/nomcopter/react-mosaic](https://github.com/nomcopter/react-mosaic)
  90. ## License
  91. Apache License 2.0 — see [LICENSE](./LICENSE).
  92. Originally developed by Kevin Verdieck at Palantir Technologies, Inc.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.