DashboardGrid

Drag-and-resize grid layout for dashboard widgets.

Preview

Usage

import { DashboardGrid } from '@ramtt/ui'

<DashboardGrid layout={layout} onLayoutChange={setLayout}>
  <DashboardGrid.Item id="1" x={0} y={0} w={6} h={3}>Widget 1</DashboardGrid.Item>
  <DashboardGrid.Item id="2" x={6} y={0} w={6} h={3}>Widget 2</DashboardGrid.Item>
</DashboardGrid>

Props

PropTypeDefaultDescription
layout*GridLayout[]Grid layout data
onLayoutChange*(layout: GridLayout[]) => voidLayout change handler
columnsnumber12Grid columns
rowHeightnumber80Row height in pixels
gapnumber16Gap between items