Skip to content

Mosyn

MIT · OPEN SOURCE · v0.3.0

Dashboards you build by dragging.

A React grid engine for draggable, resizable tiles — with nested grids and zero-remount transfer between them. Move a tile into another grid and everything inside it keeps running.

npm i mosyn

Trim space

—GitHub stars
—Weekly installs
—Gzipped
MITLicence

The problem

Most grid libraries unmount your component when it moves.

Drag a panel from one grid into another and React tears down the subtree and rebuilds it. Charts lose their zoom, forms lose half-typed input, and live connections restart.

Mosyn does not move the component. It moves the DOM node the component is already rendered into.

How it works

Rendered once. Moved as a node.

A tile's content is rendered once and projected into whichever grid owns it. When a tile transfers, React never sees an unmount, so there is nothing to restore.

  • Component state — counters, form input, and wizard steps
  • Scroll position, chart zoom, and active selections
  • Open subscriptions and in-flight requests
  • Focus and imperative canvas or WebGL contexts
  1. 01React contentMounted once
  2. 02Stable portal nodeIdentity preserved
  3. 03Tile shellGeometry moves
  4. 04Another gridNo remount

The layout engine

Layout behaviour you do not have to build.

Bring your own charts, tables, forms, and editors. Mosyn owns their geometry and interaction. Your components stay ordinary React.

Drag, split, and swap

Drop on a tile's edge and the two split the space between them. Drop on its centre and they exchange places. Drop on open canvas and the tile packs into the nearest free slot. Invalid drops are rejected on-canvas and the tile returns home.

See the interaction model

Grids inside tiles

Any tile can host a full Mosyn grid with its own store, bounds, and collision resolution. One manager coordinates the whole tree and makes movement between levels possible.

Build a nested grid

Constraint-aware resizing

Minimum and maximum sizes, neighbouring tiles, container padding, and grid boundaries are enforced throughout every resize.

Review the requirements

Quickstart

A working grid in about twenty lines.

Install the package, give the grid a parent with a real height, and keep every participating grid under one provider.

Read the full getting started guide

Give the grid a parent with a resolved height so the dashboard has a visible area to fill.

Dashboard.tsx
$ npm i mosyn react@^19 react-dom@^19

import { Mosyn, MosynManager } from 'mosyn';
import 'mosyn/style.css';

const tiles = [
  { id: 'revenue', x: 1, y: 1, w: 58, h: 18, renderer: <Revenue /> },
  { id: 'traffic', x: 61, y: 1, w: 58, h: 18, renderer: <Traffic /> },
];

export function Dashboard() {
  return (
    <MosynManager>
      <Mosyn tiles={tiles} />
    </MosynManager>
  );
}

Where Mosyn fits

More structural than a flat grid. More opinionated than drag-and-drop.

Mosyn is for application dashboards where placement, constraints, nesting, and state preservation are one problem rather than four.

CategoryGives youYou still build
Drag-and-drop primitivesSensors, draggables, and drop targetsGrid geometry, collision policy, splits, and nested layout state
Flat grid layoutsReordering and resizing on one surfaceCross-grid transfer, nesting, and state preservation
MosynPlacement, resizing, actions, nested grids, and one managerThe React content inside each tile

Built for

Layouts users rearrange while they work.

Analytics dashboards

Charts that keep their zoom and date range when the panel moves.

Trading and operations consoles

Live feeds that stay connected through a layout change.

Report and page builders

Nested sections users compose directly in the workspace.

Internal tools

Editors, tables, and forms that keep unsaved input where it was.

Project status

Early, documented, and honest about it.

Mosyn is under active development. The geometry engine is covered by 224 passing tests, and known limitations are documented rather than left for you to discover.

What is solid

Collision, packing, split arithmetic, and resize constraints are pinned by exact-value tests. The public API is small and typed.

What is early

This is a young library with an actively evolving engine. Some interaction paths are still being hardened.

MIT licensed open-source software.

Start building

Start with one grid. Scale into a complete workspace.