Grid
Grids display content in an organized fashion.
Examples
1
11
2
10
3
9
4
8
5
7
6
6
fluid
fluid
fluid
fluid
fluid
23%
17%
11%
49%
import React from 'react';
import ReactDOM from 'react-dom';
import { Grid, Row, Column as Col } from 'furl-components';
ReactDOM.render(
<Grid>
<Row>
<Col size={3}><div>3</div></Col>
<Col size={7}><div>7</div></Col>
<Col size={2}><div>2</div></Col>
</Row>
<Row>
<Col><div>fluid</div></Col>
<Col><div>fluid</div></Col>
<Col><div>fluid</div></Col>
<Col><div>fluid</div></Col>
<Col><div>fluid</div></Col>
</Row>
<Row>
<Col size={[1,3,4,'fluid']}><div>left</div></Col>
<Col size={[10,7,6,'fluid']}><div>center</div></Col>
<Col size={[1,2,2,'fluid']}><div>right</div></Col>
</Row>
<Row>
<Col size={0.23}>23%</Col>
<Col size={0.17}>17%</Col>
<Col size={0.11}>11%</Col>
<Col size={0.49}>49%</Col>
</Row>
</Grid>,
document.getElementById('root')
);
API
Property | Description | Type | Default | ||
---|---|---|---|---|---|
justify | grid main axis item alignment | string | 'start' | ||
align | grid cross axis item alignment | string | 'start' |
Property | Description | Type | Default | ||
---|---|---|---|---|---|
size | column width | string/number/array(string/number) | 'fluid' |
Notes
- A
Grid
only accepts children of theRow
component type. - A
Row
only accepts children of theColumn
component type. justify
can be one of the following:'start'
,'end'
,'center'
,'between'
,'around'
or'evenly'
.align
can be one of the following:'start'
,'end'
,'center'
,'stretch'
or'baseline'
.- A column’s
size
can either be a single value or an array of 4 values. - The value(s) of
size
can be either a string (e.g'fluid'
,'200px'
,'var(--ls-200p)'
,'calc(100vw - 20px)'
or any other valid CSS value), an integer between1
and12
(inclusive) denoting the total number of the 12 logical columns the column should occupy or a a decimal value between0.0
and1.0
(inclusive) denoting a percentage of the row’s width.