Back to rankings

nomcopter/react-mosaic

TypeScriptnomcopter.github.io/react-mosaic/

A React tiling window manager

reactwindow-managertiling-window-managertypescript
Star Growth
Stars
4.8k
Forks
243
Weekly Growth
Issues
24
2k4k
Mar 2017Apr 2020Jun 2023Jul 2026
Artifactsnpmnpm install react-mosaic
README

NPM Version React TypeScript

React Mosaic

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.

📖 Documentation · 🎮 Demo · 📚 API reference · 🚚 Migration from v6

screencast demo

Install

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';

Quick start

import { Mosaic, MosaicWindow } from 'react-mosaic-component';
import 'react-mosaic-component/react-mosaic-component.css';

export function App() {
  return (
    <div style={{ height: '100vh' }}>
      <Mosaic<string>
        renderTile={(id, path) => (
          <MosaicWindow<string> path={path} title={`Panel ${id}`}>
            <div style={{ padding: 20 }}>Contents of {id}</div>
          </MosaicWindow>
        )}
        initialValue={{
          type: 'split',
          direction: 'row',
          children: ['a', 'b'],
        }}
      />
    </div>
  );
}

That's a two-panel layout with a draggable divider, drag handles on each window title bar, and default toolbar buttons — in 15 lines.

For live editable examples, the n-ary tree model, custom toolbars, tabs, theming, and the full API reference, see the documentation site.

Features

  • N-ary tree layouts. A single split can hold any number of children, not just two.
  • Tabs as first-class citizens. Tab containers are a node type, not a bolted-on convention.
  • Controlled or uncontrolled. Pass value + onChange to manage the tree yourself, or initialValue to let the component own it.
  • Drag-and-drop. Built on react-dnd with HTML5 and touch backends.
  • Theming. Works with or without Blueprint; ships a default CSS theme plus CSS variables you can override.
  • Zero-config migration. Legacy v6 binary trees are auto-converted at render time. convertLegacyToNary is available for explicit upgrades.

Contributing

Contributions are welcome:

  • Clone and install: npm install
  • Start the docs site (hot-reloads the demo and live code blocks): npm start
  • Build the library: npm run build:lib
  • Run tests: npm test
  • Lint: npm run lint

Issues and pull requests: github.com/nomcopter/react-mosaic

License

Apache License 2.0 — see LICENSE.

Originally developed by Kevin Verdieck at Palantir Technologies, Inc.

Related repositories
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenselearn-to-codenonprofits
contribute.freecodecamp.org
452.4k45.6k
react/react

The library for web and native user interfaces.

JavaScriptnpmMIT Licensejavascriptreact
react.dev
246.7k51.3k
facebook/react

The library for web and native user interfaces.

JavaScriptnpmMIT Licensejavascriptreact
react.dev
233k47.8k
vercel/next.js

The React Framework

JavaScriptnpmMIT Licensereactserver-rendering
nextjs.org
141.1k31.5k
react/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
126.2k25.2k
facebook/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
120.9k24.5k
shadcn-ui/ui

A set of beautifully-designed, accessible components and a code distribution platform. Works with your favorite frameworks. Open Source. Open Code.

TypeScriptnpmMIT Licensecomponentsnextjs
ui.shadcn.com
119.5k9.5k
justjavac/free-programming-books-zh_CN

:books: 免费的计算机编程类中文书籍,欢迎投稿

GNU General Public License v3.0pythonjavascript
weibo.com/justjavac
117.7k28.2k
nextlevelbuilder/ui-ux-pro-max-skill

An AI SKILL that provide design intelligence for building professional UI/UX multiple platforms

PythonPyPIMIT Licenseai-skillsantigravity
uupm.cc
108.6k11.6k
react/create-react-app

Set up a modern web app by running one command.

JavaScriptnpmMIT Licensereactzero-configuration
create-react-app.dev
103.3k26.9k
facebook/create-react-app

Set up a modern web app by running one command.

JavaScriptnpmMIT Licensereactzero-configuration
create-react-app.dev
103.1k27k
ant-design/ant-design

An enterprise-class UI design language and React UI library

TypeScriptnpmMIT Licensereactui-kit
ant.design
98.8k54.7k