Skip to content

Installation

Mosyn is distributed as an ESM-only React package with a separate stylesheet export.

  • React ^19.0.0
  • React DOM ^19.0.0
  • An ESM-aware application or bundler, such as Vite or Next.js

Choose your package manager. Mosyn installs its runtime dependencies automatically, including Zustand, Immer, react-reverse-portal, and classnames.

Terminal
npm install mosyn react@^19 react-dom@^19
  1. 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.

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

    MosynManager owns the shared drag engine. Mosyn renders a grid, and Tile describes each item in the layout.

  3. Continue to Getting started to render a complete grid and set up the required height chain.