项目作者: UseAllFive

项目描述 :
React components for defining and implementing a global CSS grid
高级语言: JavaScript
项目地址: git://github.com/UseAllFive/react-global-grid.git
创建时间: 2020-05-08T18:11:45Z
项目社区:https://github.com/UseAllFive/react-global-grid

开源协议:

下载


react-global-grid

Components for creating a global CSS grid system in your React project.

NPM JavaScript Style Guide

Peer Dependencies (Requirements)

  • react
  • styled-system
  • rebass

Install

  1. npm install --save react-global-grid

Usage

  1. import React from 'react'
  2. import { ThemeProvider } from 'styled-components'
  3. import { Grid, Column } from 'react-global-grid'
  4. const theme = {
  5. gridStyles: {
  6. gridTemplateColumns: 'repeat(12, 1fr)',
  7. gridGap: 20
  8. }
  9. }
  10. const App = () => {
  11. return (
  12. <ThemeProvider theme={theme}>
  13. <Grid>
  14. <Column span='1 / 4'>column 1</Column>
  15. <Column span='5 / -1'>column 2</Column>
  16. </Grid>
  17. </ThemeProvider>
  18. )
  19. }

Further reading

Read more about it on Medium

License

MIT © UseAllFive