Skip to content

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

License

Notifications You must be signed in to change notification settings

jxnblk/react-css-grid

Repository files navigation

React CSS Grid

React layout component based on CSS Grid Layout (Demo)

Build Status

npm i react-css-grid
// Example usage
import React from 'react'
import Grid from 'react-css-grid'

class App extends React.Component {
  render () {
    return (
      <Grid
        width={320}
        gap={24}>
        <div>Column</div>
        <div>Column</div>
        <div>Column</div>
        <div>Column</div>
      </Grid>
    )
  }
}

Features

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

Props

  • width (number or string) width at which child elements will break into columns - either a number pixel value or any valid CSS width value as a string
  • gap (number or string) gutter (grid-gap) between columns - either a number pixel value or any valid CSS width value as a string

Browser Support

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

Related

MIT License

Releases

No releases published

Packages

No packages published