A row based draggable and resizable grid layout with responsive breakpoints, for React.
npm install custom-react-grid-layout


![npm downloads]()
React-Grid-Layout is a grid layout system much like Packery or
Gridster, for React.
Unlike those systems, it is responsive and supports breakpoints. Breakpoint layouts can be provided by the user
or autogenerated.
RGL is React-only and does not require jQuery.
!BitMEX UI
> GIF from production usage on BitMEX.com
[Demo | Changelog | CodeSandbox Editable demo]
- Demos
- Features
- Installation
- Usage
- Responsive Usage
- Providing Grid Width
- Grid Layout Props
- Responsive Grid Layout Props
- Grid Item Props
- User Recipes
- Performance
- Contribute
- TODO List
1. Showcase
1. Basic
1. No Dragging/Resizing (Layout Only)
1. Messy Layout Autocorrect
1. Layout Defined on Children
1. Static Elements
1. Adding/Removing Elements
1. Saving Layout to LocalStorage
1. Saving a Responsive Layout to LocalStorage
1. Minimum and Maximum Width/Height
1. Dynamic Minimum and Maximum Width/Height
1. No Vertical Compacting (Free Movement)
1. Prevent Collision
1. Error Case
1. Toolbox
1. Drag From Outside
#### Projects Using React-Grid-Layout
- BitMEX
- AWS CloudFront Dashboards
- Grafana
- Metabase
- HubSpot
- ComNetViz
- Stoplight
- Reflect
- ez-Dashing
- Kibana
- Graphext
- Monday
- Quadency
- Hakkiri
Know of others? Create a PR to let me know!
* 100% React - no jQuery
* Compatible with server-rendered apps
* Draggable widgets
* Resizable widgets
* Static widgets
* Configurable packing: horizontal, vertical, or off
* Bounds checking for dragging and resizing
* Widgets may be added or removed without rebuilding grid
* Layout can be serialized and restored
* Responsive breakpoints
* Separate layouts per responsive breakpoint
* Grid Items placed using CSS Transforms
* Performance: on / off, note paint (green) as % of time
|Version | Compatibility |
|----------------|------------------|
| >= 0.17.0 | React 0.16 |
| >= 0.11.3 | React 0.14 & v15 |
| >= 0.10.0 | React 0.14 |
| 0.8. - 0.9.2 | React 0.13 |
| < 0.8 | React 0.12 |
Install the React-Grid-Layout package package using npm:
``bash`
npm install react-grid-layout
Include the following stylesheets in your application:
``
/node_modules/react-grid-layout/css/styles.css
/node_modules/react-resizable/css/styles.css
Use ReactGridLayout like any other component. The following example below will
produce a grid with three items where:
- users will not be able to drag or resize item ab
- item will be restricted to a minimum width of 2 grid blocks and a maximum width of 4 grid blocksc
- users will be able to freely drag and resize item
`js
import GridLayout from 'react-grid-layout';
class MyFirstGrid extends React.Component {
render() {
// layout is an array of objects, see the demo for more complete usage
const layout = [
{i: 'a', x: 0, y: 0, w: 1, h: 2, static: true},
{i: 'b', x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4},
{i: 'c', x: 4, y: 0, w: 1, h: 2}
];
return (
a
b
c
)
}
}
`
You may also choose to set layout properties directly on the children:
`js
import GridLayout from 'react-grid-layout';
class MyFirstGrid extends React.Component {
render() {
return (
a
b
c
)
}
}
`
A module usable in a