0.0.2 • Published 8 years ago

react-lime-grid v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

React LIME GRID

Build Status npm version

react-lime-grid for React.js

https://tsuyoshiwada.github.io/react-lime-grid/

Table of Contents

Install

Install lime-grid.css and react-lime-grid.

$ npm install lime-grid.css react-lime-grid --save

# or

$ yarn add lime-grid.css react-lime-grid

Setup

To use react-lime-grid, you need to import lime-grid.css.

Basic

Add <link> to <head>.

$ cp node_modules/lime-grid.css/lime-grid.min.css ./path/to/
<link rel="stylesheet" href="/path/to/lime-grid.min.css">

webpack

Use the following 2 loaders.

webpac.config.js

{
  test: /\.css$/,
  include: /node_modules/,
  // or
  // include: /node_modules\/lime-grid\.css/,
  use: ['style-loader', 'css-loader'],
},

index.js

import 'lime-grid.css';

PostCSS

See lime-grid.css.

Usage

import React from 'react';
import { Container, Row, Col } from 'react-lime-grid';

const MyComponent = () => (
  <Container>
    <Row>
      <Col xs={12} lg={4}>...</Col>
      <Col xs={12} lg={4}>...</Col>
      <Col xs={12} lg={4}>...</Col>
    </Row>
  </Container>
);

See more detail for https://tsuyoshiwada.github.io/react-lime-grid/

API

Container

proptypedefault
classNamestringnull
childrenReact$Element<any>null
tagNamestring'div'
fluidbooleanfalse

Row

proptypedefault
classNamestringnull
childrenReact$Element<any>null
tagNamestring'div'
startGridBreakpointnull
centerGridBreakpointnull
endGridBreakpointnull
topGridBreakpointnull
middleGridBreakpointnull
bottomGridBreakpointnull
aroundGridBreakpointnull
betweenGridBreakpointnull
reverseGridBreakpointnull

GridBreakpoint is type defined as follows

type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type GridBreakpoint = Breakpoint | Breakpoint[];

Col

proptypedefault
classNamestringnull
childrenReact$Elemen<any>null
tagNamestring'div'
xsnumbernull
smnumbernull
mdnumbernull
lgnumbernull
xlnumbernull
xlnumbernull
xsOffsetnumbernull
smOffsetnumbernull
mdOffsetnumbernull
lgOffsetnumbernull
xlOffsetnumbernull
firstboolean or GridBreakpointfalse
lastboolean or GridBreakpointfalse

Changelog

See CHANGELOG.md

Contribute

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Run $ npm test
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request :D

Bugs, feature requests and comments are more than welcome in the issues.

License

MIT © tsuyoshiwada