0.1.0 • Published 5 years ago

react-stylegrid v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

react-stylegrid

Lightweight CSS Grid implementation for React.

Install

yarn add react-stylegrid

// or

npm install react-stylegrid

Usage

Example

<Grid>
  <Col size={3}></Col>
  <Col size={6}>
    <h1>Example</h1>
    <h2>This is an example column in the center</h2>
  </Col>
  <Col size={3}></Col>
</Grid>

Grid

The Grid component is the main container for the grid. It should contain all columns and rows.

PropDescriptionDefault Value
colsAmount of columns in a row.12
colSizeSize of each column.'1fr'
rowSizeSize of each row.'auto'
colGapSize of gap between each column.0
rowGapSize of gap between each row.0
<Grid>
  {/* ... */}
</Grid>

Col

The Col component is a column in the grid, the main building-block in a CSS Grid system.

PropDescriptionDefault Value
sizeSpan size (amount of grid spaces this column spans).'auto'
startStart position within the grid.'auto'
endEnd position within the grid.'auto'
<Grid>
  <Col></Col>
</Grid>

Row

The Row component is a row in the grid, which contains columns.

PropDescriptionDefault Value
sizeSpan size (amount of grid spaces this row spans).'auto'
startStart position within the grid.'auto'
endEnd position within the grid.'auto'
<Grid>
  <Row>
    <Col></Col>
    <Col></Col>
    <Col></Col>
  </Row>
</Grid>
0.1.1

5 years ago

0.1.0

5 years ago