1.3.1 • Published 6 years ago

fbox v1.3.1

Weekly downloads
7
License
ISC
Repository
github
Last release
6 years ago

FBox

Flexbox Component for Reactjs. Powered by Styled-Components.

Motivation

Flexbox is really powerful but it have to write so many css style. Moreover, we have to write a lot of boilerplate code to set the layout of our component for example FBox will turn following boilerplate style to something more sugar!

display: flex;
flex-direction: row;
justify-content: center;
alignItems: center;
padding: 10px;

with FBox you can just write...

<FBox row center alignCenter p="10px">.....</FBox>

Installation

npm install --save fbox

Usage

import FBox from 'fbox'
...
...
<FBox alignCenter center p="10px">
    ....Your contents...
</FBox>

Noted: Usually, you will have to use nested FBox together to create a layout.

Example

please check /stories/index.js for example usage. You also use npm run storybook to run the sample on your machine.

Props

Props that is Boolean type you just have to add props name to FBox like this <FBox center alignCenter>...</FBox>

Props that is string type you have to add value to FBox like this <FBox background="red" p="10px" ml="2em">...</FBox>

Prop TypeProp NameGenerate CSS
Booleancolumnflex-direction: column;
BooleancolumnReverseflex-direction: column-reverse;
Booleanrowflex-direction: row;
BooleanrowReverseflex-direction: row-reverse;
Booleancenterjustify-content: column-reverse;
BooleanflexStartjustify-content: column-reverse;
BooleanflexEndjustify-content: flex-end;
Booleanbaselinejustify-content: baseline;
BooleanspaceBetweenjustify-content: space-between;
BooleanspaceAroundjustify-content: space-around;
BooleancontentCenteralign-content: content-center;
BooleancontentFlexStartalign-content: flex-start;
BooleancontentFlexEndalign-content: flex-end;
BooleancontentBaselinealign-content: baseline;
BooleancontentSpaceBetweenalign-content: space-between;
BooleancontentSpaceAroundalign-content: space-around;
BooleanalignCenteralign-items: center;
BooleanalignFlexStartalign-items: flex-start;
BooleanalignFlexEndalign-items: flex-end;
BooleanalignBaselinealign-items: baseline;
BooleanalignStretchalign-items: stretch;
BooleanselfCenteralign-self: center;
BooleanselfFlexStartalign-self: flex-start;
BooleanselfFlexEndalign-self: flex-end;
BooleanselfBaselinealign-self: baseline;
BooleanselfStretchalign-self: stretch;
Booleangrow1flex-grow: 1;
Booleangrow2flex-grow: 2;
Booleangrow3flex-grow: 3;
Booleangrow4flex-grow: 4;
Booleangrow5flex-grow: 5;
Booleanshrink1flex-shrink: 1;
Booleanshrink2flex-shrink: 2;
Booleanshrink3flex-shrink: 3;
Booleanshrink4flex-shrink: 4;
Booleanshrink5flex-shrink: 5;
Booleanwrapflex-wrap: wrap;
Booleannowrapflex-wrap: nowrap;
BooleanwrapReverseflex-wrap: wrap-reverse;
stringbackgroundbackground: ____;
stringwidthwidth: ____;
stringheightheight: ____;
stringppadding: ____;
stringptpadding-top: ____;
stringprpadding-right: ____;
stringpbpadding-bottom: ____;
stringplpadding-left: ____;
stringmmargin: ____;
stringmtmargin-top: ____;
stringmrmargin-right: ____;
stringmbmargin-bottom: ____;
stringmlmargin-left: ____;
1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago