Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-grid-system

Package Overview
Dependencies
Maintainers
1
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-grid-system

A pure JS bootstrap-like grid system for React.

  • 1.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
increased by127.5%
Maintainers
1
Weekly downloads
 
Created
Source

react-grid-system

A pure JS bootstrap-like responsive grid system for React.

npm version

Installation

npm install react-grid-system --save

Responsive grid components

Three components are provided for creating responsive grids: Container, Row, and Col.

An example on how to use these:

<Container>
  <Row>
    <Col xs={12} md={8}>xs=12 md=8</Col>
    <Col xs={6} md={4}>xs=6 md=4</Col>
  </Row>
</Container>

Responsive utilities

Three components are provided for creating responsive grids: Visible and Hidden.

An example on how to use these:

<Visible xs sm><div>Visible on extra small and small</div></Visible>
<Visible md lg><div>Visible on medium and large</div></Visible>

Documentation

Live examples and documentation can be found at the GitHub pages: https://zoover.github.io/react-grid-system/

React context types

The following child context types can be provided to the grid components, to alter their responsive behavior:

Context TypeDefault ValueDescription
phonefalseWhen set to true, a default viewport width of 375 pixels will be used, in case the viewport width cannot be determined by using the window object. This is useful for server-side rendering.
tabletfalseWhen set to true, a default viewport width of 768 pixels will be used, in case the viewport width cannot be determined by using the window object. This is useful for server-side rendering.
breakpoints[768, 992, 1200]The breakpoints (minimum width) of devices in class sm, md, and lg. The default values are based on the Bootstrap 3 breakpoints.
containerWidths[750, 970, 1170]The container widths in pixels of devices in class sm, md, and lg. The default values are based on the Bootstrap 3 container widths.

For more information on using the user-agent to determine server-side whether a device is a phone or tablet, see for example https://github.com/hgoebl/mobile-detect.js.

For more information about context in React, see https://facebook.github.io/react/docs/context.html.

Keywords

FAQs

Package last updated on 19 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc