af-react-grid
Resizable and customizable flexbox grid for React.
Code example:
Container props
Resizer props
Features
- Very small, exported as es modules (own code 3.5kb + react + react-dom + react-draggable + classNames)
- Resizers are also given
data-resizer-index
anddata-resizer-type
, so their styling could be customized easily; resizerChildren
andresizerClassName
props are passed deep to all nestedContainer
s, so you want to declare these props only on rootContainer
. Of course they may be overriden anywhere;maxHeight
,minHeight
,maxWidth
,minWidth
are considered even if not declared inline, because their values are taken fromgetComputedStyle
before drag starts;- Want to have a super-highly customized
Resizer
?resizerChildren
prop allows you to render custom child elements, which could be easily styled; localStorageKey
prop is passed down to children with child index added, likesomeGridName_0_2
, until overriden;- If a child has
key
prop, it's dimensions are saved by key, otherwise by it's index, so be careful to use unique keys;
Tooltips
- If tou want
overflow: auto
on containers, you must either set it globally( add overflow rule to default container class ), or individually; React.Fragment
children are not yet supported;Resizer
, which is first or last child, does nothing( see example );- Feel free to customize
Resizer
styling by providing your own css( usedist/resizer.style.css
as an example )
TODO
- Support
React.Fragment
children. - Add types
findDomNode
refuse ( maybe? )