
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
react-styled-flexboxgrid-r17
Advanced tools
Grid system based on styled-components and flexbox for React 17. Forked from react-styled-flexbox
Set of React components that implement flexboxgrid.css
but with styled-components
/emotion
. Furthermore, it allows to customize grid configuration like gutter width...
Highly inspired by the excellent react-flexbox-grid
which the API is nearly the same than this module.
npm i -S react-styled-flexboxgrid-v2
react-styled-flexboxgrid
depends on 2 peer dependencies:
react@^17.0.2
prop-types@^15.0.0-0
styled-components@2
You should install them in your project.
import React from 'react'
import {Grid, Col, Row} from 'react-styled-flexboxgrid'
const App = props =>
<Grid>
<Row>
<Col xs={6} md={3}>Hello, world!</Col>
</Row>
</Grid>
The <Grid>
component is optional and can help to wrap children in a fixed/fluid container. Use the configuration container
for fixed width value.
fluid
(Boolean): Create a responsive fixed width container or a full width container, spanning the entire width of your viewport. Default: falsereverse
(Boolean): Use flex-direction: row-reverse
. Default: falsestart
center
end
top
middle
bottom
around
between
first
last
(String(xs|sm|md|lg): Align elements to the start or end of row as well as the top, bottom, or center of a column.reverse
(Boolean): Use flex-direction: column-reverse
. Default: falsexs
sm
md
lg
(Boolean|Integer):
true
, enable auto sizing column.false
, hide colomn for the breakpoint.integer
value, it specify the column size on the grid. (1 to 12)xsOffset
smOffset
mdOffset
lgOffset
(Integer): Offset the column.The grid use same defaults than flexboxgrid.css
.
You can customize values using <ThemeProvider>
component from styled-components.
react-styled-flexboxgrid
will looks at the flexboxgrid
property in the theme.
import React from 'react'
import {ThemeProvider} from 'styled-components'
import {Grid, Col, Row} from 'react-styled-flexboxgrid'
const theme = {
flexboxgrid: {
// Defaults
gridSize: 12, // columns
gutterWidth: 1, // rem
outerMargin: 2, // rem
mediaQuery: 'only screen',
container: {
sm: 46, // rem
md: 61, // rem
lg: 76 // rem
},
breakpoints: {
xs: 0, // em
sm: 48, // em
md: 64, // em
lg: 75 // em
}
}
}
const App = props =>
<ThemeProvider theme={theme}>
<Grid>
<Row>
<Col xs={6} md={3}>Hello, world!</Col>
</Row>
</Grid>
</ThemeProvider>
To use react-styled-flexboxgrid with emotion, import from 'react-styled-flexboxgrid/emotion':
import { Grid, Col, Row } from 'react-styled-flexboxgrid/emotion'
MIT
FAQs
Grid system based on styled-components and flexbox for React 17. Forked from react-styled-flexbox
We found that react-styled-flexboxgrid-r17 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.