react flexbox component
npm install react-flexify --save
;
// flex container hi // flex-item, hi // flex-item, hi hi // normal html element ... .... // flex-container, section.bla.fcol.f-ai-s(data-custom='hi') > aside
Usage:
<Flex inline // display: inline-flex row // flex-direction, default column // flex-direction: column justifyContent='flex-start|...' alignItems='center' alignContent='center' alignSelf='auto' order='1' wrap='wrap' tag='article' // wrapper html element tag, default: 'div' grow='1' shrink='1' basis='1' flex='1 2 400px' data-custom-data // custom attrs > </Flex>
-
All props are optional. if none of
inline|row|column
is present, then just renderthis.props.children
wrapped withtag
(default isdiv
) -
inline
=> flex display level, set this to change toinline-flex
. (default isflex
) -
row|column
=> A flex container, with flex-direction: row|column; and other default rules display: flex; justify-content: space-around; align-items: center; align-content: center; flex-wrap: wrap -
... set other props to override its default value.
-
can also pass other props(
data-
), will be set on wrapper element