Skip to content

Drag and resize

People can move tiles into open space, arrange them around other tiles, and resize a selected tile from any edge or corner.

Use DragCancel to exclude controls from starting a drag. Pass standard element selectors and any application-specific selector you use for interactive content.

Dashboard.tsx
<Mosyn
tiles={dashboardTiles}
DragCancel={['button', 'input', 'textarea', 'select', 'a', '.no-drag']}
/>

Apply .no-drag to custom controls such as chart tooltips, menus, or embedded editors.

TileToolbar.tsx
export function TileToolbar() {
return (
<button className="no-drag" type="button">
Open report
</button>
);
}

Drag a tile into free space to reposition it. When the pointer overlaps another tile, Mosyn previews the available contextual action:

Pointer position Result
Empty space Reposition the tile
Centre of a tile Exchange the two positions
Edge of a tile Split the available region in that direction

The preview is the confirmation to follow. Release only when the resulting arrangement is the one you intend.

Click a tile to select it. Mosyn exposes handles on the four edges and four corners. Drag a handle to change the dimensions in that direction.

Use tile constraints to keep the result practical.

tiles.tsx
const chartTile: Tile = {
id: 'revenue',
x: 1,
y: 1,
w: 58,
h: 18,
minW: 30,
minH: 14,
maxH: 36,
renderer: <RevenueChart />,
};

Disable editing when the dashboard is view-only

Section titled “Disable editing when the dashboard is view-only”

Use disabled for dashboards that should preserve their current arrangement, such as a shared report or read-only preview.

DashboardPreview.tsx
<Mosyn tiles={dashboardTiles} disabled />

This disables selection, drag interaction, resizing, and the space-trimming affordance for that grid.

Mosyn currently uses mouse interaction. Build a separate touch-first interface for devices that need direct touch manipulation, and keep keyboard-accessible alternatives for actions users must be able to perform without a mouse.