Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jxnblk/react-css-grid

React layout component based on CSS Grid Layout and built with styled-components
https://github.com/jxnblk/react-css-grid

css-grid css-grid-layout grid-layout layout react react-component styled-components

Last synced: about 2 months ago
JSON representation

React layout component based on CSS Grid Layout and built with styled-components

Awesome Lists containing this project

README

        

# React CSS Grid

React layout component based on [CSS Grid Layout][spec] and built with [styled-components][sc]

[![Build Status][travis-badge]][travis]
[![GitHub][stars]][gh]

[Demo](http://jxnblk.com/react-css-grid/docs)

[travis-badge]: https://img.shields.io/travis/jxnblk/react-css-grid/master.svg?style=flat-square
[travis]: https://travis-ci.org/jxnblk/react-css-grid
[gh]: https://github.com/jxnblk/react-css-grid
[stars]: https://img.shields.io/github/stars/jxnblk/react-css-grid.svg?style=social&label=Star

```sh
npm i react-css-grid
```

```jsx
// Example usage
import React from 'react'
import Grid from 'react-css-grid'

class App extends React.Component {
render () {
return (

Column

Column

Column

Column


)
}
}
```

## Features

- Responsive grid layout with zero media queries
- Simple API for handling tiled layouts
- Customizable column width and gutters

## Props

### `width` (number or string)

Sets the width at which child elements will break into columns.
Pass a number for pixel values or a string for any other valid CSS length.

```jsx

```

### `gap` (number or string)

Sets the gutter (`grid-gap`) between columns.
Pass a number for pixel values or a string for any other valid CSS length.

```jsx

```

### `align` (string)

Sets `align-items` to control child element alignment.

## Browser Support

See http://caniuse.com/#feat=css-grid

## Related

- [Grid Styled](https://github.com/jxnblk/grid-styled)
- [Styled System](https://github.com/jxnblk/styled-system)
- [styled-components][sc]
- [CSS Grid Layout Module][spec]
- [CSS Grid Layout on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout)
- [Grid by Example](https://gridbyexample.com/video/series-auto-fill-auto-fit/)
- [Spring Into CSS Grid](http://jonibologna.com/spring-into-css-grid/)

[spec]: https://www.w3.org/TR/css-grid-1/
[demo]: http://jxnblk.com/react-css-grid/
[sc]: https://styled-components.com

[MIT License](LICENSE.md)