Flexbox
Utilities for controlling flexbox layouts.Import
API
Fromflexbox/flexbox.js:56-70:
Container Properties
flexDirection
Set the direction of flex items:flexbox.js:8-10:
flexWrap
Control whether flex items wrap:flexbox.js:12-14:
justifyContent
Align items along the main axis:flexbox.js:16-18:
alignItems
Align items along the cross axis:flexbox.js:20-22:
alignContent
Align wrapped flex lines:flexbox.js:24-26:
justifyItems
Align items along the inline axis (for grid and flex):flexbox.js:48-50:
Item Properties
flex
Shorthand for flex-grow, flex-shrink, and flex-basis:flexbox.js:32-34:
flexGrow
Control how much an item grows:flexbox.js:36-38:
flexShrink
Control how much an item shrinks:flexbox.js:40-42:
flexBasis
Set the initial size of a flex item:flexbox.js:4-6:
alignSelf
Override alignItems for individual items:flexbox.js:44-46:
justifySelf
Align an item along the inline axis:flexbox.js:52-54:
order
Control the order of flex items:flexbox.js:28-30:
Common Patterns
Centered Content
Navigation Bar
Card Layout
Responsive Grid
Sidebar Layout
Responsive Flexbox
TypeScript
Available Properties
| Prop | CSS Property | Values |
|---|---|---|
flexDirection | flex-direction | row, column, row-reverse, column-reverse |
flexWrap | flex-wrap | nowrap, wrap, wrap-reverse |
justifyContent | justify-content | flex-start, center, flex-end, space-between, space-around, space-evenly |
alignItems | align-items | flex-start, center, flex-end, stretch, baseline |
alignContent | align-content | flex-start, center, flex-end, space-between, space-around, stretch |
flex | flex | Number or string |
flexGrow | flex-grow | Number |
flexShrink | flex-shrink | Number |
flexBasis | flex-basis | Length or auto |
alignSelf | align-self | auto, flex-start, center, flex-end, stretch, baseline |
order | order | Number |
justifyItems | justify-items | flex-start, center, flex-end, stretch |
justifySelf | justify-self | auto, flex-start, center, flex-end, stretch |