Skip to content

Build dashboard layouts

Mosyn starts from the tile array you provide. A good starting layout gives people a useful dashboard immediately, then leaves room for them to make it their own.

Keep the initial tile array outside the component when it is static. If it is derived from data, memoize it before passing it to <Mosyn />.

tiles.tsx
import type { Tile } from 'mosyn';
export const dashboardTiles: Tile[] = [
{ id: 'summary', x: 1, y: 1, w: 38, h: 18, renderer: <Summary /> },
{ id: 'activity', x: 41, y: 1, w: 38, h: 18, renderer: <Activity /> },
{ id: 'alerts', x: 81, y: 1, w: 38, h: 18, renderer: <Alerts /> },
];

Use IDs that represent the dashboard feature, not its current position. summary stays meaningful if a person moves it to another part of the dashboard.

The root grid has 120 columns. x and y set a tile’s top-left position; w and h set how many grid units it occupies.

Field Use it for
x Horizontal placement
y Vertical placement
w Tile width
h Tile height

Place tiles from 1, not 0. Leave one unit between adjacent tiles in your initial layout so the dashboard has a clear gutter.

tiles.tsx
export const dashboardTiles: Tile[] = [
{ id: 'summary', x: 1, y: 1, w: 58, h: 18, renderer: <Summary /> },
{ id: 'activity', x: 61, y: 1, w: 58, h: 18, renderer: <Activity /> },
];

Use minimum and maximum dimensions when a tile needs to remain useful at a particular size. A table might need a minimum width; a compact status card may need a maximum height.

tiles.tsx
export const dashboardTiles: Tile[] = [
{
id: 'orders',
x: 1,
y: 1,
w: 78,
h: 24,
minW: 38,
minH: 18,
renderer: <OrdersTable />,
},
];

Use constraints sparingly. They are most valuable when content genuinely stops being usable below a certain size.

Mosyn sizes the tile. Your renderer should make its own root element fill that space.

Summary.tsx
export function Summary() {
return <section className="dashboard-panel">Summary</section>;
}
dashboard.css
.dashboard-panel {
width: 100%;
height: 100%;
overflow: hidden;
}

This keeps charts, tables, and panels aligned as a tile is resized.

Give the first row to the dashboard’s primary information, then group related supporting work below it. Large tiles should communicate importance, not simply hold more content.

For dashboards with several kinds of work, use a container tile to create a distinct workspace. See Nested grids when one part of a dashboard needs its own local arrangement.