Unopinionated, standard compliant flexbox component. No propietary APIs. Nothing but flexbox.
npm install flexbox-reactflexbox-react
flexbox-react components.No more , , , , or any other
arbitrarily named and _spec_ ed components to layout your apps.
No more first={true}, ternary={true}, spaced={true},grouped={true}
or any other arbitrarily named and _spec_ ed props to layout your apps.
flexbox-react is agnostic of which post/pre css build flow you have, it works out of the box. It's agnostic to it. You could have all your styling on css files. Or all inlined. This sits just in the middle. It might be a good idea to see your components and know how they are laid out without jumping between css files or arbitrary, layout-exclusive components specifications.
userAgent.No need to import any new stylesheet or to add any styles to your
existing stylesheets. It works out of the box, just by using the
component.
``sh`
yarn add flexbox-reactor
npm install --save flexbox-react
js
import Flexbox from 'flexbox-react';// ...
Header
Content
Footer
`
Sticky footer!As you can see, there're some extra props as _layout_ ing helpers. Those are
height, minHeight, maxHeight, width, minWidth, maxWidth, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, and marginLeft. The idea of flexbox-react is to be a complete solution to build layouts. Since, well, flexbox is a complete solution to build layouts. It's all about the sugar. Feel free to create an issue or submit a PR if you think there's room for improvement here!$3
If you need to use a tag other than
for the layout, like or , you can pass an extra element prop to the component:`html
...
`which will render to this:
`html
...
``If TypeScript is your cup of tea, check the type definitions, we support them too.
MIT © Ignacio Álvarez
[npm-url]: https://npmjs.org/package/flexbox-react
[npm-image]: https://img.shields.io/npm/v/flexbox-react.svg
[depstat-url]: https://david-dm.org/nachoaIvarez/flexbox-react
[depstat-image]: https://david-dm.org/nachoaIvarez/flexbox-react.svg
[download-badge]: http://img.shields.io/npm/dm/flexbox-react.svg