1.3.0 • Published 2 years ago

@illa-design/grid v1.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Grid

Grid is used to create consistent page structures and responsive page layouts.

Installation

yarn add @illa-design/grid

Import components

import { Row, Col } from "@illa-dedign/grid"

API

Row Basic Properties

PropsDescTypeDefault
horizontalGapthe size of the horizontal interval betweent grids, could be a string or an object like { xs: "4px", sm: "8px", md: "12px"}string | GridSize"0px"
verticallGapThe size of the vertical interval betweent grids, could be a string or an object like { xs: "4px", sm: "8px", md: "12px"}string | GridSize"0px"
alignVertical alignment"start" | "center" | "end" | "stretch""start"
justifyHorizontal alignment"start" | "center" | "end" | "space-around" | "space-between""start"

Col Basic Properties

PropsDescTypeDefault
spanRaster number of cells to occupynumber24
offsetThe number of cells to offset Col from the leftnumber0
orderRaster ordernumber-
pushMove the raster to rightnumber-
pullMove the raster to rleftnumber-
xsResponsive configuration when screen< 576pxnumber | { key: string: any }-
smResponsive configuration when screen>= 576pxnumber | { key: string: any }-
mdResponsive configuration when screen>= 768pxnumber | { key: string: any }-
lgResponsive configuration when screen>= 992pxnumber | { key: string: any }-
xlResponsive configuration when screen>= 1200pxnumber | { key: string: any }-
xxlResponsive configuration when screen>= 1600pxnumber | { key: string: any }-

Example

Basic usage

<Row>
  <Col span={8}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-02`),
        color: "white",
      }}
    >
      Col-1-span-8
    </div>
  </Col>
  <Col span={16}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-06`),
        color: "white",
      }}
    >
      Col-2-span-16
    </div>
  </Col>
</Row>

Set offset of Col

<Row>
  <Col span={8}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-02`),
        color: "white",
      }}
    >
      Col-1-span-8
    </div>
  </Col>
  <Col span={8} offset={8}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-06`),
        color: "white",
      }}
    >
      Col-2-offset-8
    </div>
  </Col>
</Row>

Set interval of Grid

<Row horizontalGap="24px" verticalGap="24px">
  <Col span={8}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-02`),
        color: "white",
      }}
    >
      Col-1-span-8
    </div>
  </Col>
  <Col span={16}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-06`),
        color: "white",
      }}
    >
      Col-2-span-16
    </div>
  </Col>
</Row>

Set horizontal and vertical layout

<Row justify="center" align="end">
  <Col span={8}>
    <div
      style={{
        borderRadius: "6px",
        height: "50px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-02`),
        color: "white",
      }}
    >
      Col-1-span-8
    </div>
  </Col>
  <Col span={8}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-06`),
        color: "white",
      }}
    >
      Col-2-span-8
    </div>
  </Col>
</Row>

Set order of Col

<Row>
  <Col span={8}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-02`),
        color: "white",
      }}
    >
      Col-1-order-2
    </div>
  </Col>
  <Col span={16}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-06`),
        color: "white",
      }}
    >
      Col-2-order-1
    </div>
  </Col>
</Row>

Set responsive layout

<Row>
  <Col xs={4} sm={8} md={12} lg={16} xl={20}>
    <div
      style={{
        borderRadius: "6px",
        height: "50px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-02`),
        color: "white",
      }}
    >
      Col-1
    </div>
  </Col>
  <Col xs={20} sm={16} md={12} lg={8} xl={4}>
    <div
      style={{
        borderRadius: "6px",
        height: "80px",
        backgroundColor: globalColor(`--${illaPrefix}-blue-06`),
        color: "white",
      }}
    >
      Col-2
    </div>
  </Col>
</Row>
1.2.0

2 years ago

1.3.0

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.30

2 years ago

1.1.0

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.20

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.11

2 years ago

1.0.10

3 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago