A Flexbox React component harnessing the power of styled-components
Switch branches/tags
Nothing to show
Clone or download
Steven Akins
Steven Akins 2.0.0
Latest commit a6f0377 Sep 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build update dependencies Jun 4, 2018
src update README and comments Sep 7, 2018
.babelrc initial commit Jul 21, 2017
.eslintrc.json update dependencies Jun 4, 2018
.gitignore initial commit Jul 21, 2017
.npmignore update dependencies Jun 4, 2018
.travis.yml add Travis CI support and eslint Nov 17, 2017
LICENSE Initial commit Jul 21, 2017
README.md update README and comments Sep 7, 2018
index.html initial commit Jul 21, 2017
package-lock.json 2.0.0 Sep 7, 2018
package.json 2.0.0 Sep 7, 2018
webpack.config.demo.js initial commit Jul 21, 2017

README.md

react-styled-flexbox

Effortlessly add flexbox styles to your components using minimal code.

Build Status

Installation

NPM

npm install react-styled-flexbox --save

Yarn

yarn add react-styled-flexbox

API

import FlexContainer from 'react-styled-flexbox';

<FlexContainer>
  <div>I'm on the left!</div>
  <div>I'm on the right!</div>
</FlexContainer>

By default FlexContainer will render a div with 'display: flex' and default flexbox style rules.

If you want to add additional flexbox rules to your FlexContainer you can pass in options set to true.

<FlexContainer directionColumn={true}>
  <div>I'm on the top!</div>
  <div>I'm underneath!</div>
</FlexContainer>

Options

inline-flex:

  • inline

flex-direction:

  • directionRowReverse
  • directionColumn
  • directionColumnReverse

flex-wrap:

  • wrapWrap
  • wrapWrapReverse

align-items:

  • itemsFlexStart
  • itemsFlexEnd
  • itemsCenter
  • itemsBaseline

align-content:

  • contentFlexStart
  • contentFlexEnd
  • contentCenter
  • contentSpaceBetween
  • contentSpaceAround

justify-content:

  • justifySpaceBetween
  • justifySpaceAround
  • justifyFlexEnd
  • justifyCenter

If you are not familiar with the flexible box model please review the MDN docs

License

MIT License

Copyright (c) 2017 Raycom Media, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.