Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mukhindev/react-grid

Grid for React with a headless UI and simple parameters
https://github.com/mukhindev/react-grid

columns grid headless headlessui react ui

Last synced: 3 days ago
JSON representation

Grid for React with a headless UI and simple parameters

Awesome Lists containing this project

README

        

# @mukhindev/react-grid

Grid for React with a headless UI and simple parameters

Demo: https://github.com/mukhindev/react-grid-demo

## Install

⚠️ Dependencies: Need support for CSS modules in your configuration.

```
npm install @mukhindev/react-grid
```

## CSS Modules

Package components use the CSS modules without pre-processing, so you can process them to suit your build. Vite and Next.js support CSS modules.

## Grid and Cell

```
┏━━━━━━━┳━━━┓
┃ A ┃ B ┃
┣━━━━━━━┻━━━┫
┃ C ┃
┗━━━━━━━━━━━┛
```

```JavaScript
import { Grid, Cell } from "@mukhindev/react-grid";

function MyComponent() {
return (

A
B
C

);
}
```

## Styles with className

```JavaScript
function MyComponent() {
return (

A
B

);
}
```

## Styles with Material UI (MUI)

https://mui.com/material-ui

```TypeScript
import Grid from "../ui/Grid";
import Cell from "../ui/Cell";

function MyComponent() {
return (

A
B

);
}
```

```TypeScript
// ui/Grid.tsx
import { Grid, GridProps } from "@mukhindev/react-grid";
import { Box, BoxProps } from "@mui/material";

export default function MuiGrid(props: GridProps & BoxProps) {
return ;
}
```

```TypeScript
// ui/Cell.tsx
import { Cell, CellProps } from "@mukhindev/react-grid";
import { Box, BoxProps } from "@mui/material";

export default function MuiCell(props: CellProps & BoxProps) {
return ;
}
```