ResponsiveDndGrid
Breakpoint-aware grid layout component.
Import
import { ResponsiveDndGrid } from "@dnd-grid/react";Use ResponsiveDndGrid when you need breakpoint layouts. For a single layout,
use DndGrid. If you already have a measured
width, pass width directly.
Props
Core props
layoutsResponsiveLayoutsBreakpoint → layout map. Missing layouts are derived from the nearest larger breakpoint (default behavior).
childrenReactNoderequiredGrid items; each child key must match a layout item id.
Measurement
widthnumberOptional container width in pixels. When provided, measurement is skipped.
measureBeforeMountbooleanDefault: trueDelay rendering until the container width is measured.
initialWidthnumberDefault: 1280Width value used before measuring when rendering early.
containerPropsHTMLAttributes<HTMLDivElement>Props applied to the measurement wrapper.
Responsive configuration
breakpointsBreakpointsBreakpoint map, defaults to lg, md, sm, xs, xxs.
colsBreakpointColsColumn count per breakpoint.
gapResponsiveSpacingDefault: 10Gap per breakpoint (number or spacing object).
containerPaddingResponsiveSpacing | nullDefault: nullPadding per breakpoint (or null to use gap).
defaultLayoutsResponsiveLayoutsUncontrolled initial layouts per breakpoint.
compactorCompactorCompaction strategy used for layout generation and collisions.
missingLayoutStrategy"derive" | "warn" | "error" | "empty"Control how missing breakpoint layouts are handled.
onBreakpointChange(bp, cols) => voidFires when the active breakpoint changes.
onLayoutsChange(layouts) => voidFires when any breakpoint layout changes.
onLayoutChange(layout, layouts) => voidFires when the active breakpoint layout changes.
onWidthChange(width, gap, cols, padding) => voidFires on width or breakpoint configuration changes.
Grid configuration & behavior
ResponsiveDndGrid supports the same grid configuration, behavior, accessibility,
and styling props as DndGrid (e.g. rowHeight,
draggable, resizable, autoSize, slotProps, and callbacks).