Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-bem-grid
Advanced tools
A BEM-ified port of Flexbox Grid to a simple, reusable React component.
A BEM-ified port of Flexbox Grid to a simple, reusable React component.
npm install --save react-bem-grid
import React from 'react';
import { Grid, Row, Col } from 'react-bem-grid';
class GridExample extends React.Component {
render() {
return (
<Grid>
<Row>
<Col xs={12} sm={6} lg={4}>
...
</Col>
<Col xs={12} sm={6} lg={4}>
...
</Col>
<Col xs={12} sm={6} lg={4}>
...
</Col>
</Row>
</Grid>
);
}
}
Include the css file in the way that best suits your project, if you're using Webpack, we recommend using CSS loader.
Responsive modifiers enable specifying different column sizes, offsets, alignment and distribution at xs, sm, md & lg viewport widths.
<Grid>
<Row>
<Col xs={12} sm={8} md={6} lg={4}>
...
</Col>
</Row>
</Grid>
Offset a column.
<Grid>
<Row>
<Col xs={8} xsOffset={4} sm={6} smOffset={6} lg={12}>
...
</Col>
</Row>
</Grid>
Add any number of auto sizing columns to a row. Let the grid figure it out.
<Grid>
<Row>
<Col xs>
...
</Col>
<Col xs>
...
</Col>
<Col xs>
...
</Col>
</Row>
</Grid>
Nest grids inside grids inside grids.
<Grid>
<Row>
<Col xs={12}>
<Row>
<Col xs={6}>
<Row>
<Col xs={4}>
...
</Col>
<Col xs={4}>
...
</Col>
<Col xs={4}>
...
</Col>
</Row>
</Col>
<Col xs={6}>
<Row>
<Col xs={6}>
...
</Col>
<Col xs={6}>
...
</Col>
</Row>
</Col>
</Row>
</Col>
</Row>
</Grid>
Add the componentClass property to override the default element type of a Grid, Row or Col.
<Grid>
<Row componentClass='nav'>
<Col xs={6}>
...
</Col>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
Add properties to align elements to the start or end of a row as well as the top, bottom, or center of a column.
<Grid>
<Row xsStart>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
<Grid>
<Row xsCenter>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
<Grid>
<Row xsEnd>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
Here is an example of using the modifiers in conjunction to achieve different alignment at different viewport sizes.
<Grid>
<Row xsCenter smEnd lgStart>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
<Grid>
<Row xsTop>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
<Grid>
<Row xsMiddle>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
<Grid>
<Row xsBottom>
<Col xs={6}>
...
</Col>
</Row>
</Grid>
Add properties to distribute the contents of a row or column.
<Grid>
<Row xsAround>
<Col xs={2}>
...
</Col>
<Col xs={2}>
...
</Col>
<Col xs={2}>
...
</Col>
</Row>
</Grid>
<Grid>
<Row xsBetween>
<Col xs={2}>
...
</Col>
<Col xs={2}>
...
</Col>
<Col xs={2}>
...
</Col>
</Row>
</Grid>
Add properties to reorder columns.
<Grid>
<Row>
<Col xs={4}>
1
</Col>
<Col xs={4}>
2
</Col>
<Col xs={4} xsFirst>
3
</Col>
</Row>
</Grid>
<Grid>
<Row>
<Col xs={4} xsLast>
1
</Col>
<Col xs={4}>
2
</Col>
<Col xs={4}>
3
</Col>
</Row>
</Grid>
<Grid>
<Row reverse>
<Col xs={4}>
1
</Col>
<Col xs={4}>
2
</Col>
<Col xs={4}>
3
</Col>
</Row>
</Grid>
First, clone react-bem-grid, install dependencies and build the project:
git clone https://github.com/nordnet/react-bem-grid.git
npm install
npm run build
Then run the simple-grid or documentation example project:
cd examples/simple-grid
npm install
npm start
MIT © Nordnet Bank AB
FAQs
A BEM-ified port of Flexbox Grid to a simple, reusable React component.
The npm package react-bem-grid receives a total of 1 weekly downloads. As such, react-bem-grid popularity was classified as not popular.
We found that react-bem-grid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.