1.3.0 • Published 5 years ago

react-styled-box v1.3.0

Weekly downloads
838
License
MIT
Repository
github
Last release
5 years ago

npm version

react-styled-box

What is it ?

This is a simple styled.div component, that makes your basic positioning of elements faster. Instead of writing all of the "styled" components upfront you can prototype the layout faster with this ready <Box>.

How it works ?

import Box from 'react-styled-box';

<Box flexDirection="column">
  <Box flexDirection="row">
    <span> header </span>
    <span> header 2 </span>
  </Box>

  <Box flexGrow={1}>
    <Box margin={10} padding="10px 0 0 0">
      Item one
    </Box>
    <Box margin={10} padding="10px 0 0 0">
      Item two
    </Box>
  </Box>
</Box>

What does it support ?

Check A Complete Guide to FlexBox

propTypevalid typessample valuesdescription
displaystring'flex', 'block'flex - default value
margininteger, string10, '50%'number values are suffixed with px
paddinginteger, string10, '50%'number values are suffixed with px
widthinteger, string10, '50%'number values are suffixed with px
maxWidthinteger, string10, '50%'number values are suffixed with px
minWidthinteger, string10, '50%'number values are suffixed with px
heightinteger, string10, '50%'number values are suffixed with px
maxHeightinteger, string10, '50%'number values are suffixed with px
minHeightinteger, string10, '50%'number values are suffixed with px
flexDirectionstring'row', 'column'
flexWrapstring'nowrap', 'wrap'
flexFlowstring'column nowrap', 'row wrap'
justifyContentstring'flex-start', 'center'
alignItemsstring'base-line', 'flex-start'
alignContentstring'flex-start', 'space-around'
orderinteger1, 2
flexGrowinteger1, 2
flexShrinkinteger1, 0
flexBasisinteger, string30, 'auto', '30%'number values are suffixed with px
flexstring'0 1 auto', '1 0'
alignSelfstring'auto', 'flex-start'
overflowstringvisible, hidden
overflowXstringvisible, hidden
overflowYstringvisible, hidden
1.3.0

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago