npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-pure-grid

v2.1.1

Published

A highly customizable set of React components that mirror bootstrap responsive grid system, AND not dependent on any css file

Downloads

74

Readme

React-Pure-Grid

React-Pure-Grid is a set of React components that mirror Bootstrap grid system. This library harmoniously integrates with your React project and it's easily customizable and very flexible.

React-Pure-Grid is NOT dependent on any external css files.

Installation

React-Pure-Grid is available as an npm package.

npm install react-pure-grid --save

Usage

Using React-Pure-Grid is very straightforward. Once react-pure-grid is included in your project, you can use the components this way:

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

const App = () => (
      <Container>
        <Row>
          <Col xs={6} md={4} lg={3}>Hello, world!</Col>
        </Row>
        <Row>
            <Col xsOffset={5} xs={7}>Welcome!</Col>
        </Row>
      </Container>
);

##Customization Beginning with v2.0.0, Styling the grid system to your liking is simple and hassle-free. This can be achieved by using the PureGridProvider to inject the customizations into your application context. Following that, you can to use any of the components as demonstrated in the documentation.

The following are the possible customizations:

###props gutterSize number [default = 15] The gutter size to separate cols

maxWidth number [default = 1170] Maximum container width

replaceBreakPoints boolean [default = false] This determines whether to merge or replace the provided breakPoints with the default breakPoints. We highly recommend you leave this untouched

breakPoints object Each entry is an object containing two keys:

{
    browser     : number, /* The browser width */
    container   : number, /* The width to apply to a container within this breakpoint */
}
// Default breakPoints
{
   lg: {
      browser: 1200,
      container: 1170
  },
  md: {
      browser: 992,
      container: 870
  },
  sm: {
      browser: 768,
      container: 750
  },
  xs: {
      browser: 0,
      container: 'auto'
  }
}

Here is a quick example to get you started:

###./App.js

import React from 'react';
import {render} from 'react-dom';
import {PureGridProvider} from 'react-pure-grid';
import MyAwesomeReactComponent from './MyAwesomeReactComponent';

const App = () => (
  <PureGridProvider gutterSize={4}>
    <MyAwesomeReactComponent />
  </PureGridProvider>
);

render(<App />, document.getElementById('app'));

###./MyAwesomeReactComponent.js

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

const MyAwesomeReactComponent = () => (
  <Container>
    <Row>
        <Col xs={12} md={6}>
            My Col Data
        </Col>
    </Row>
  </Container>
);

export default MyAwesomeReactComponent;

##Components

1. Container

fluid boolean [default = true] Fluid or Fixed-Width layout

2. Row

reverse boolean [default = false] Set to true to output Cols in reverse order

align string [default = start] Accepts one of start|center|end. Vertical alignment of Cols with varying heights

justify string [default = start] Accepts one of start|center|end. Horizontal alignment of Cols when they don't occupy full width

3. Col

* number Number of columns [1-12] to use as Col width

*Offset number Number of columns [1-12] to offset

Note: * is a key in breakPoints object Example: <Col md={4} xsOffset={2}>Col Content</Col>

Browser Support

Supported in all major browsers

Contribute

If you have a feature request, please add it as an issue or make a pull request.

License

MIT