# @pmwcs/grid

> PMWCS grid component

Latest version **1.1.0** (published 2021-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pmwcs/grid
pnpm add @pmwcs/grid
yarn add @pmwcs/grid
bun add @pmwcs/grid
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-06-20 |
| First published | 2020-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Maintainers | commenthol |
| Keywords | pmwcs, preact, material, web, components, grid |

## Links

- npm: https://www.npmjs.com/package/@pmwcs/grid
- Repository: https://github.com/pmwcs/pmwcs
- Homepage: https://github.com/pmwcs/pmwcs#readme
- Issues: https://github.com/pmwcs/pmwcs/issues
- npm.io page: https://npm.io/package/@pmwcs/grid

## Dependencies (2)

- [@pmwcs/base](https://npm.io/package/@pmwcs/base.md) ^1.1.0
- [@material/layout-grid](https://npm.io/package/@material/layout-grid.md) ^7.0.0

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-06-20
- 1.0.0-2 (next) — 2020-09-05
- 1.0.2 — 2020-12-30
- 1.0.1 — 2020-10-11
- 1.0.0 — 2020-10-07
- 1.0.0-1 — 2020-08-30

## README

# 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.

- Module **@pmwcs/grid**
- Import styles:
  - Using CSS Loader
    - import '@pmwcs/grid/styles';
  - Or include stylesheets
    - **'@material/layout-grid/dist/mdc.layout-grid.css'**
- MDC Docs: [https://material.io/develop/web/components/layout-grid/](https://material.io/develop/web/components/layout-grid/)

```jsx
<Grid>
  <GridCell span={4}>1</GridCell>
  <GridCell span={4}>2</GridCell>
  <GridCell span={4}>3</GridCell>
</Grid>
```

```jsx
<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

| Name | Type | Description |
|------|------|-------------|
| `align` | `"left" \| "right"` | Specifies the alignment of the whole grid. |
| `children` | `React.ReactNode` | Children for the Grid |
| `fixedColumnWidth` | `undefined \| false \| true` | Specifies the grid should have fixed column width. |


## GridCell
A Grid cell

### Props

| Name | Type | Description |
|------|------|-------------|
| `align` | `"top" \| "middle" \| "bottom"` | Specifies the alignment of cell |
| `desktop` | `undefined \| number` | Number of columns to span on a desktop. |
| `order` | `undefined \| number` | Specifies the order of the cell. |
| `phone` | `undefined \| number` | Number of columns to span on a phone. |
| `span` | `undefined \| number` | Default number of columns to span. |
| `tablet` | `undefined \| number` | Number of columns to span on a tablet. |


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

---
_Source: https://npm.io/package/@pmwcs/grid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
