Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
react-grid-system
Advanced tools
A no CSS Bootstrap-like responsive grid system for React.
npm install react-grid-system --save
Three components are provided for creating responsive grids: Container
, Row
, and Col
.
An example on how to use these:
<Container>
<Row>
<Col sm={4}>
One of three columns
</Col>
<Col sm={4}>
One of three columns
</Col>
<Col sm={4}>
One of three columns
</Col>
</Row>
</Container>
Three components are provided for creating responsive grids: Visible
and Hidden
.
Some examples on how to use these:
<p>
<span>Your current screen class is </span>
<Visible xs><strong>xs</strong></Visible>
<Visible sm><strong>sm</strong></Visible>
<Visible md><strong>md</strong></Visible>
<Visible lg><strong>lg</strong></Visible>
<span>.</span>
</p>
<Visible xs sm>
<p>Paragraph visible on extra small and small.</p>
</Visible>
<Hidden xs sm>
<p>Paragraph hidden on extra small and small.</p>
</Hidden>
<Visible md lg>
<p>Paragraph visible on medium and large.</p>
</Visible>
<Hidden md lg>
<p>Paragraph hidden on medium and large.</p>
</Hidden>
The following child context types can be provided to the grid components, to alter their responsive behavior:
Context Type | Default Value | Description |
---|---|---|
phone | false | When 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. |
tablet | false | When 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 screen 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 screen class sm , md , and lg . The default values are based on the Bootstrap 3 container widths. |
An simple example application using all the features of react-grid-system
can be found at https://github.com/zoover/react-grid-system/tree/master/example.
More examples and documentation of all components can be found at the GitHub pages: https://zoover.github.io/react-grid-system/
FAQs
A powerful Bootstrap-like responsive grid system for React.
The npm package react-grid-system receives a total of 39,743 weekly downloads. As such, react-grid-system popularity was classified as popular.
We found that react-grid-system demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.