SHAKTI

Layout

Shakti contains several components for designing layouts, including a flexbox-based grid system.

Grid System

The grid system is loosely similar to Bootstrap's grid structure:

<Grid bgColor="#feccfe" borderRadius={8} textCenter>
<Row>
<Col>🌲</Col>
<Col>🍄</Col>
</Row>
<Row>
<Col>🍁</Col>
</Row>
</Grid>
🌲
🍄
🍁

All of the grid components (Grid, Row, and Col) have flex enabled by default, and all Flex props apply.

Grid

Serves as a container component for a layout. Rows (Row) are nested within. Grid is flex-enabled with column direction by default.

Row

Represents a physical row in a layout. Columns (Col) are nested within. Row is flex-enabled with row direction by default.

Col

Represents a physical column in a layout. Nested within a Row. Col is flex-enabled with column direction by default.

PropTypeNotes
sizenumberrelative width of column in row (defaults to 1)
showBelowstringmedia breakpoint to show column at (shown at breakpoint or smaller)
showAbovestringmedia breakpoint to show column at (shown at breakpoint or larger)
hideBelowstringmedia breakpoint to hide column at (hidden at breakpoint or smaller)
hideAbovestringmedia breakpoint to hide column at (hidden at breakpoint or larger)

Other

Aside from the grid system components, there are some other layout components designed to be used independently.

View

Vanilla div with the ability to augment via Base props.

Flex

Same as View, but with flex enabled by default and access to Flex props:

PropTypeNotes
flexRowbooleanset flex direction to row
flexColbooleanset flex direction to column
flexRowReversebooleanset flex direction to row-reverse
flexColReversebooleanset flex direction to column-reverse
alignStartbooleanalign items to flex-start
alignEndbooleanalign-items to flex-end
alignCenterbooleanalign items to center
alignBaselinebooleanalign items to baseline
justifyStartbooleanjustify content to flex-start
justifyEndbooleanjustify content to flex-end
justifyCenterbooleanjustify content to center
justifyBaselinebooleanjustify content to baseline
justifySpaceAroundbooleanjustify content with space around
justifySpaceBetweenbooleanjustify content with space between