Grids
Flex grids use flexbox to position columns within rows.
Props
Grid props
Property | Required | Type | Default | Description |
---|---|---|---|---|
gutter | no | boolean | true | When true, adds spacing between FlexCol s |
flexDirection | no | oneOf(['row', 'row-reverse', 'column', 'column-reverse']) | Sets the flex direction | |
justifyContent | no | oneOf(['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly']) | Sets the justify-content CSS property |
FlexCol props
Property | Required | Type | Default | Description |
---|---|---|---|---|
alignment | no | oneOf(['top', 'middle', 'bottom']) | Alignment of the column within the Grid | |
breakpoint | no | oneOf(['sm', 'md', 'lg']) | Width of window at which column will expand to take up full width of Grid (sm = 768px , md = 992px , lg = 1200px ) | |
col | no | number | Fraction out of 24 that this column's width should be in its Grid | |
contentAlignment | no | oneOf(['top', 'middle', 'bottom']) | Alignment of the column's contents within itself | |
fixed | no | boolean | false | When true, column width is fixed to the width of its content |
grow | no | number | 1 | The ratio of the column's width relative to other columns in the same Grid |
Imports
Import React components (including CSS):
import {Grid, FlexCol} from 'pivotal-ui/react/flex-grids';
Import CSS only:
import 'pivotal-ui/css/flex-grids';