Installation
Mosyn is distributed as an ESM-only React package with a separate stylesheet export.
Requirements
Section titled “Requirements”- React
^19.0.0 - React DOM
^19.0.0 - An ESM-aware application or bundler, such as Vite or Next.js
Install the package
Section titled “Install the package”Choose your package manager. Mosyn installs its runtime dependencies automatically, including Zustand, Immer, react-reverse-portal, and classnames.
npm install mosyn react@^19 react-dom@^19pnpm add mosyn react@^19 react-dom@^19yarn add mosyn react@^19 react-dom@^19bun add mosyn react@^19 react-dom@^19Complete the setup
Section titled “Complete the setup”-
Import the stylesheet
Section titled “Import the stylesheet”Import the compiled stylesheet once from your application entry point. The JavaScript bundle does not inject styles.
main.tsx import 'mosyn/style.css';Without this import, tile positioning, resize handles, and drag-preview overlays will not render correctly.
-
Verify the package exports
Section titled “Verify the package exports”Your first grid needs the provider, grid component, tile type, and stylesheet.
Dashboard.tsx import { Mosyn, MosynManager } from 'mosyn';import type { Tile } from 'mosyn';import 'mosyn/style.css';MosynManagerowns the shared drag engine.Mosynrenders a grid, andTiledescribes each item in the layout. -
Render your first grid
Section titled “Render your first grid”Continue to Getting started to render a complete grid and set up the required height chain.