Giter Club home page Giter Club logo

styled-flexboxgrid's Introduction

styled-flexboxgrid

NPM JavaScript Style Guide

Grid system based on flexboxgrid2 and styled-components for React

Install

$ npm install @krystiankoper/styled-flexboxgrid --save

or

$ yarn add @krystiankoper/styled-flexboxgrid

styled-flexboxgrid depends on these peer dependencies:

  • prop-types@^15.5.4
  • react@^15.0.0 || ^16.0.0
  • react-dom@^^15.0.0 || ^16.0.0
  • styled-components@2

You have to install them in your project.

Usage

import React from 'react';
import { Container, Row, Col } from '@krystiankoper/styled-flexboxgrid';

class App extends React.Component {
  render() {
    return (
      <Container fluid>
        <Row>
          <Col xs={12} sm={6} md={3} lg={2} xl={1}>
            Styled FlexboxGrid
          </Col>
        </Row>
      </Container>
    );
  }
}

Container

Props Type Value Style
fluid Boolean true padding-right: 1rem;
padding-left: 1rem;
Without fixed widths for breakpoints
fluid Boolean false padding-right: 0.5rem;
padding-left: 0.5rem;
Fixed widths for breakpoints

Col

Props Type Value Style
reverse Boolean true flex-direction: column-reverse;
reverse Boolean false flex-direction: column;
xs sm md lg xl Boolean true flex-grow: 1;
flex-basis: 0;
max-width: 100%;
xs sm md lg xl Boolean false display: none;
xs sm md lg xl Integer 1-12 flex-basis: ((100 / 12) * value)%
max-width: ((100 / 12) * value)%
xsOffset
smOffset
mdOffset
lgOffset
xlOffset
Integer 1-12 margin-left: ((100 / 12) * value)%

Row

Props Type Value Style
reverse Boolean true flex-direction: row-reverse;
reverse Boolean false flex-direction: row;
start One of type xs
sm
md
lg
xl
justify-content: flex-start;
center One of type xs
sm
md
lg
xl
justify-content: center;
end One of type xs
sm
md
lg
xl
justify-content: flex-end;
top One of type xs
sm
md
lg
xl
align-items: flex-start;
middle One of type xs
sm
md
lg
xl
align-items: center;
bottom One of type xs
sm
md
lg
xl
align-items: flex-end;
around One of type xs
sm
md
lg
xl
justify-content: space-around;
between One of type xs
sm
md
lg
xl
justify-content: space-between;
first One of type xs
sm
md
lg
xl
order: -1;
last One of type xs
sm
md
lg
xl
order: 1;

License

MIT © krystiankoper

styled-flexboxgrid's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.