1.1.0 • Published 3 years ago

@pmwcs/grid v1.1.0

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

Layout Grid

Material design’s responsive UI is based on a column-variate grid layout. It has 12 columns on desktop, 8 columns on tablet and 4 columns on phone.

<Grid>
  <GridCell span={4}>1</GridCell>
  <GridCell span={4}>2</GridCell>
  <GridCell span={4}>3</GridCell>
</Grid>
<Grid>
  {/* If you need additional control over height of your grid, or need to add SubGrids, you can add your own GridRow components. */}
  <GridRow>
    <GridCell span={6}>1</GridCell>
    <GridCell span={6}>
      <GridRow>
        <GridCell span={6}>a</GridCell>
        <GridCell span={6}>b</GridCell>
      </GridRow>
    </GridCell>
  </GridRow>
</Grid>

Grid

A Grid component

Props

NameTypeDescription
align"left" \| "right"Specifies the alignment of the whole grid.
childrenReact.ReactNodeChildren for the Grid
fixedColumnWidthundefined \| false \| trueSpecifies the grid should have fixed column width.

GridCell

A Grid cell

Props

NameTypeDescription
align"top" \| "middle" \| "bottom"Specifies the alignment of cell
desktopundefined \| numberNumber of columns to span on a desktop.
orderundefined \| numberSpecifies the order of the cell.
phoneundefined \| numberNumber of columns to span on a phone.
spanundefined \| numberDefault number of columns to span.
tabletundefined \| numberNumber of columns to span on a tablet.

GridRow

By default, an inner grid component is included inside of . Use GridRow when doing nested Grids.