<Div row> Use flexbox with ease in React! </Div>
- Easy to read & use flexbox!
- Accepts all standard div props! (like
style,classNameandid) - Typescript support!
# with yarn:
yarn add div
# with npm:
npm install --save divimport React, { Component } from 'react'
import { Div } from 'div'
const Example = () => {
return (
<Div row>
<Div column flex={1}>
A third of the space
</Div>
<Div column flex={2}>
Two thirds of space!
</Div>
</Div>
)
}(All props are optional)
- Applies
flex: {number}. - Reminder: the flex shorthand params are in this order:
flex-grow,flex-shrink,flex-basis(without commas)
- Makes div a flex row.
- Applies
display: flexandflex-direction: row.
- Makes div a flex column.
- Applies
display: flexandflex-direction: column.
- Reverses the flex-direction if
columnorroware specified.
- Applies
flex-wrap: 'wrap'. - By default, a div's
flex-wrapis'nowrap'.
- Centers content if
roworcolumnare specified. - Applies
justify-content: 'center'andalign-items: 'center'.
MIT © Wulf