3.0.0 • Published 3 years ago

@arterial/layout-grid v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Arterial Layout Grid

Another React Material Layout Grid

Installation

npm install @arterial/layout-grid

Usage

Styles

Sass

@use "@material/layout-grid/mdc-layout-grid.scss";

CSS

import '@material/layout-grid/dist/mdc.layout-grid.css';

JSX

import {Grid, GridRow, GridCell} from '@arterial/layout-grid';

Regular Layout Grid

<Grid className="grid grid--regular">
  <GridRow>
    <GridCell className="grid-cell"></GridCell>
    <GridCell className="grid-cell"></GridCell>
    <GridCell className="grid-cell"></GridCell>
  </GridRow>
</Grid>

Other Variants

Left Aligned

<Grid className="grid grid--regular" align="left">
  <GridRow>
    <GridCell className="grid-cell"></GridCell>
    <GridCell className="grid-cell"></GridCell>
    <GridCell className="grid-cell"></GridCell>
  </GridRow>
</Grid>

Right Aligned

<Grid className="grid grid--regular" align="right">
  <GridRow>
    <GridCell className="grid-cell"></GridCell>
    <GridCell className="grid-cell"></GridCell>
    <GridCell className="grid-cell"></GridCell>
  </GridRow>
</Grid>

Columns

<Grid className="grid">
  <GridRow>
    <GridCell className="grid-cell" span={6}></GridCell>
    <GridCell className="grid-cell" span={3}></GridCell>
    <GridCell className="grid-cell" span={2}></GridCell>
    <GridCell className="grid-cell" span={1}></GridCell>
    <GridCell className="grid-cell" span={3}></GridCell>
    <GridCell className="grid-cell" span={1}></GridCell>
    <GridCell className="grid-cell" span={8}></GridCell>
  </GridRow>
</Grid>

Cell Alignment

<Grid className="grid grid--cell-alignment">
  <GridRow className="grid-inner">
    <GridCell className="grid-cell grid-cell--alignment" align="top"></GridCell>
    <GridCell
      className="grid-cell grid-cell--alignment"
      align="middle"
    ></GridCell>
    <GridCell
      className="grid-cell grid-cell--alignment"
      align="bottom"
    ></GridCell>
  </GridRow>
</Grid>

Props

Grid

NameTypeDescription
alignleft | rightSpecifies alignment of the whole grid. Defaults to center.
childrennodeElements to be displayed within root element.
classNamestringClasses to be applied to the root element.
fixedColumnWidthbooleanEnables a fixed width column variant.
tagstring | objectHTML tag to be applied to the root element. Defaults to div.

GridRow

NameTypeDescription
childrennodeElements to be displayed within root element.
classNamestringClasses to be applied to the root element.
tagstring | objectHTML tag to be applied to the root element. Defaults to div.

GridCell

NameTypeDescription
aligntope | middle | bottomSpecifies alignment of the whole grid. Defaults to center.
childrennodeElements to be displayed within root element.
classNamestringClasses to be applied to the root element.
ordernumberSpecifies order of the cell.
spannumberSpecifies the number of columns the cell spans.
spanDesktopnumberSpecifies the number of columns the cell spans on a desktop.
spanPhonenumberSpecifies the number of columns the cell spans on a phone.
spanTabletnumberSpecifies the number of columns the cell spans on a tablet.
tagstring | objectHTML tag to be applied to the root element. Defaults to div.
3.0.0

3 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.3

4 years ago

1.0.0-alpha.6

4 years ago

1.0.0-alpha.5

4 years ago

1.0.0-alpha.4

4 years ago

1.0.0-alpha.3

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha.0

4 years ago