Nested grids
Use a nested grid when a dashboard area needs its own local arrangement: a project workspace, a grouped report, or a drill-down panel.
Create a container tile
Section titled “Create a container tile”A container tile owns its child tiles. Set isContainer to true, provide children, and render a second <Mosyn /> from its renderer.
import { Mosyn } from 'mosyn';import type { Tile } from 'mosyn';
const workspaceTiles: Tile[] = [ { id: 'notes', parentId: 'workspace', x: 1, y: 1, w: 24, h: 14, renderer: <Notes /> }, { id: 'tasks', parentId: 'workspace', x: 27, y: 1, w: 24, h: 14, renderer: <Tasks /> },];
export const workspace: Tile = { id: 'workspace', x: 1, y: 21, w: 78, h: 40, isContainer: true, children: workspaceTiles, renderer: (tile) => <Mosyn tiles={tile.children ?? []} container={tile} />,};The container prop identifies the nested grid and gives it the dimensions of its parent tile. The nested grid is displayed by your renderer; Mosyn does not generate that application UI for you.
Use one provider for the whole workspace
Section titled “Use one provider for the whole workspace”Place the root grid and every nested grid inside the same MosynManager.
import { Mosyn, MosynManager } from 'mosyn';
export function Dashboard() { return ( <MosynManager> <Mosyn tiles={[workspace]} /> </MosynManager> );}Do not add a second provider around the child grid. A shared provider is what lets Mosyn coordinate the complete workspace.
Keep child IDs unique
Section titled “Keep child IDs unique”Give every tile a unique id, including tiles in different nested grids. The id is the identity Mosyn uses to track content and movement.
const workspaceTiles: Tile[] = [ { id: 'workspace-notes', parentId: 'workspace', x: 1, y: 1, w: 24, h: 14, renderer: <Notes /> }, { id: 'workspace-tasks', parentId: 'workspace', x: 27, y: 1, w: 24, h: 14, renderer: <Tasks /> },];Treat the container renderer as current state
Section titled “Treat the container renderer as current state”Use the tile argument passed to renderer. It carries the current children collection for that container.
renderer: (tile) => <Mosyn tiles={tile.children ?? []} container={tile} />Avoid closing over the original workspaceTiles array in the renderer. The current tile is the source Mosyn updates as the nested workspace changes.