Draggable Grid

Pannable grid with smooth drag and momentum

draggable-grid-tw
Dog 1
Dog 3
Dog 2
Dog 5
Dog 1
Dog 2
Dog 4
Dog 7
Dog 1
Dog 2
Dog 3
Dog 6
Dog 4
Dog 7
Dog 1
Dog 3
Dog 1
Dog 7
Dog 1
Dog 2
Dog 3
Dog 3
Dog 5
Dog 4
Dog 1
Dog 7
Dog 5
Dog 1
Dog 1
Dog 2
Dog 2
Dog 3
Dog 4
Dog 4
Dog 1
Dog 2
Dog 7
Dog 2
Dog 5
Dog 3
Dog 6
Dog 7
Dog 3
Dog 7
Dog 5
Dog 5
Dog 4
Dog 7
Dog 3
Dog 3
Dog 3
Dog 3
Dog 5
Dog 4
Dog 3
Dog 3
Dog 1
Dog 4
Dog 5
Dog 5

Customize

60
10
0.9
0.5
0.6
6
1

Props

NameTypeDefaultDescription
itemsGridItem[][]Array of items to display in the grid. Each item has id, image, dataId, and alt.
columnsnumber10Number of columns in the grid layout.
enableDragbooleantrueEnable drag functionality to move the grid around.
enableWheelbooleantrueEnable mouse wheel scrolling to navigate the grid.
edgeResistancenumber0.9Edge resistance when dragging (0-1). Higher values provide more resistance.
introDurationnumber1.2Duration of the intro animation in seconds.
onItemClick(item: GridItem, index: number) => voidundefinedCallback function when an item is clicked.
classNamestring""Additional CSS classes for the main container.
gridClassNamestring""Additional CSS classes for the grid container.
itemClassNamestring""Additional CSS classes for individual grid items.
boundsPadding{ x: number; y: number }{ x: 200, y: 100 }Padding in pixels for drag bounds.
containerMode"fixed" | "absolute""absolute"Container positioning mode. 'fixed' for full viewport overlay, 'absolute' for contained layout.
scalenumber1Scale factor for the entire grid. 0.5 = half size, 2 = double size.
gapnumber5Gap between items in viewport width units (vw).
wheelSmoothingnumber0.3Wheel scroll smoothing duration in seconds (0.1-1.0). Higher values create smoother, slower scrolling.

Demo images from thiings.co, not part of the React Bits Pro offer.