All Projects → LoicMahieu → React Styled Flexboxgrid

LoicMahieu / React Styled Flexboxgrid

Licence: mit
Grid system based on styled-components and flexbox for React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Styled Flexboxgrid

Griz
Grid library for React; Rescue the cat
Stars: ✭ 99 (-80.78%)
Mutual labels:  grid, styled-components, flexbox
React Flexa
Responsive React Flexbox (CSS Flexible Box Layout Module) grid system based heavily on the standard CSS API.
Stars: ✭ 120 (-76.7%)
Mutual labels:  grid, styled-components, flexbox
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+303.69%)
Mutual labels:  grid, styled-components, flexbox
fortune
🔮Fortune is your friendly CSS properties framework.
Stars: ✭ 16 (-96.89%)
Mutual labels:  grid, flexbox
react-styled-flexbox
A Flexbox React component harnessing the power of styled-components
Stars: ✭ 30 (-94.17%)
Mutual labels:  styled-components, flexbox
tetris-grid
◼️Lightweight and simple CSS grid
Stars: ✭ 16 (-96.89%)
Mutual labels:  grid, flexbox
cice-playground
CICE Full Stack Web Course
Stars: ✭ 12 (-97.67%)
Mutual labels:  grid, flexbox
vue-grid
A powerful flexbox grid system for Vue.js 2.x, built with inline-styles
Stars: ✭ 23 (-95.53%)
Mutual labels:  grid, flexbox
grd-sass
Sass port of 1000ch/grd that is a CSS grid framework using Flexbox.
Stars: ✭ 12 (-97.67%)
Mutual labels:  grid, flexbox
workshop-css-grid
Workshop made for freecodecamp meetup
Stars: ✭ 12 (-97.67%)
Mutual labels:  grid, flexbox
gymnast
🤸 Configurable grid and layout engine for React
Stars: ✭ 35 (-93.2%)
Mutual labels:  grid, flexbox
rebass
⚛️ React primitive UI components built with styled-system.
Stars: ✭ 7,844 (+1423.11%)
Mutual labels:  grid, styled-components
griding
🧱 lean grid & responsive for react
Stars: ✭ 18 (-96.5%)
Mutual labels:  grid, flexbox
hagrid
📏 Hagrid is a mixin library for responsive websites and web applications.
Stars: ✭ 30 (-94.17%)
Mutual labels:  grid, flexbox
inuit-flexgrid
Flexbox grid for inuitcss
Stars: ✭ 32 (-93.79%)
Mutual labels:  grid, flexbox
ReactSimpleFlexGrid
A way to quickly add a Grid Layout to your React app 🚀
Stars: ✭ 185 (-64.08%)
Mutual labels:  grid, flexbox
gridy
A Flexbox Grid System powered by SASS
Stars: ✭ 28 (-94.56%)
Mutual labels:  grid, flexbox
gutter-grid
A Sass flexbox based grid system that is able to replicate CSS grid-gap in IE11
Stars: ✭ 18 (-96.5%)
Mutual labels:  grid, flexbox
Pintsize
Customisable 💪 Flexbox grid system
Stars: ✭ 330 (-35.92%)
Mutual labels:  grid, flexbox
React Datepicker
An easily internationalizable, accessible, mobile-friendly datepicker library for the web, build with styled-components.
Stars: ✭ 252 (-51.07%)
Mutual labels:  grid, styled-components

react-styled-flexboxgrid

npm version Build Status NPM Status js-standard-style

Set of React components that implement flexboxgrid.css but with styled-components/emotion. Furthermore, it allows to customize grid configuration like gutter width...

Highly inspired by the excellent react-flexbox-grid which the API is nearly the same than this module.

Demo

Usage

Installation

npm i -S react-styled-flexboxgrid

react-styled-flexboxgrid depends on 2 peer dependencies:

You should install them in your project.

Basic

import React from 'react'

import {Grid, Col, Row} from 'react-styled-flexboxgrid'

const App = props =>
  <Grid>
    <Row>
      <Col xs={6} md={3}>Hello, world!</Col>
    </Row>
  </Grid>

Grid

The <Grid> component is optional and can help to wrap children in a fixed/fluid container. Use the configuration container for fixed width value.

Props
  • fluid (Boolean): Create a responsive fixed width container or a full width container, spanning the entire width of your viewport. Default: false

Row

Props
  • reverse (Boolean): Use flex-direction: row-reverse. Default: false
  • start
  • center
  • end
  • top
  • middle
  • bottom
  • around
  • between
  • first
  • last (String(xs|sm|md|lg): Align elements to the start or end of row as well as the top, bottom, or center of a column.

Col

Props
  • reverse (Boolean): Use flex-direction: column-reverse. Default: false
  • xs
  • sm
  • md
  • lg (Boolean|Integer):
    • When true, enable auto sizing column.
    • When false, hide colomn for the breakpoint.
    • When integer value, it specify the column size on the grid. (1 to 12)
  • xsOffset
  • smOffset
  • mdOffset
  • lgOffset (Integer): Offset the column.

Configuration

The grid use same defaults than flexboxgrid.css.

You can customize values using <ThemeProvider> component from styled-components. react-styled-flexboxgrid will looks at the flexboxgrid property in the theme.

import React from 'react'

import {ThemeProvider} from 'styled-components'
import {Grid, Col, Row} from 'react-styled-flexboxgrid'

const theme = {
  flexboxgrid: {
    // Defaults
    gridSize: 12, // columns
    gutterWidth: 1, // rem
    outerMargin: 2, // rem
    mediaQuery: 'only screen',
    container: {
      sm: 46, // rem
      md: 61, // rem
      lg: 76  // rem
    },
    breakpoints: {
      xs: 0,  // em
      sm: 48, // em
      md: 64, // em
      lg: 75  // em
    }
  }
}

const App = props =>
  <ThemeProvider theme={theme}>
    <Grid>
      <Row>
        <Col xs={6} md={3}>Hello, world!</Col>
      </Row>
    </Grid>
  </ThemeProvider>

Use with Emotion

To use react-styled-flexboxgrid with emotion, import from 'react-styled-flexboxgrid/emotion':

import { Grid, Col, Row } from 'react-styled-flexboxgrid/emotion'

Related projects

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].