Spacer
React An element to repesent space between other elements, for use in flexbox layouts.
Works both on the web and in React Native.
Installation
npm install --save react-spacer
Usage
const Spacer = const React = const render = const Header = <div style= display: 'flex' > <div>MyApp</div> <Spacer grow='1' /> <div>Login</div> <Spacer width='12px' /> <div>Sign up</div> </div>
Will render something like this:
MyApp Login Sign Up
Props
width
- optional
- type:
string
ornumber
The width of the space.
height
- optional
- type:
string
ornumber
The height of the space.
grow
- optional
- type:
string
ornumber
The flex grow factor of the space.
shrink
- optional
- type:
string
ornumber
The flex shrink factor of the space.