Responsive layouts
Mosyn’s root grid keeps a consistent 120-column layout model while the width of each column adapts to the available space. Your application controls the dashboard host, breakpoints, and surrounding UI.
Give the dashboard an elastic host
Section titled “Give the dashboard an elastic host”The grid fills its parent. In a page shell or application panel, make the host a flexible area with a real height.
.dashboard-page { display: flex; flex-direction: column; min-height: 100vh;}
.dashboard-host { display: flex; flex: 1; min-height: 0;}export function Dashboard() { return ( <main className="dashboard-page"> <DashboardHeader /> <section className="dashboard-host"> <Mosyn tiles={dashboardTiles} /> </section> </main> );}min-height: 0 allows the grid to scroll inside the space assigned to it instead of making the whole page grow.
Design tiles for smaller widths
Section titled “Design tiles for smaller widths”Tile geometry is fluid; the content inside a tile still needs responsive UI. Use your normal CSS media queries for labels, controls, tables, and charts.
.dashboard-panel { container-type: inline-size; width: 100%; height: 100%;}
@container (width < 22rem) { .dashboard-panel .secondary-label { display: none; }}Container queries are particularly useful because a tile can become narrow independently of the browser viewport.
Use constraints to protect usability
Section titled “Use constraints to protect usability”Set minW and minH on tiles whose content must not shrink past a usable size.
const tableTile: Tile = { id: 'orders', x: 1, y: 1, w: 78, h: 24, minW: 38, minH: 18, renderer: <OrdersTable />,};The right constraint is based on the content: the number of readable table columns, the minimum chart width, or the room required for a control row.
Change the surrounding product UI at breakpoints
Section titled “Change the surrounding product UI at breakpoints”Mosyn does not ask you to produce a separate layout object for each breakpoint. Instead, let the grid scale, and change the app chrome around it when the viewport becomes compact.
@media (width < 48rem) { .dashboard-header { align-items: flex-start; flex-direction: column; }
.dashboard-actions { width: 100%; }}For a radically different mobile experience, render the view designed for that product surface rather than trying to compress a dense desktop dashboard into a phone screen.