Skip to content
Advertisement

Limiting containers to three fixed sizes

I’m looking at the react-grid-layout which is based on Material Design’s 12 column grid. Is there a way to provide pre-defined sizes for containers to stick to the following 3 sizes: 1 full width (12 cols), half grid (6 cols) or 1/3 grid (4 cols)?

Sandbox

Advertisement

Answer

My guess is that when you say container, you’re referring to the layout items. If that is the case, use a custom onResize method. Using the sandbox code you have from your question:

JavaScript

DEMO

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement