Gathering detailed insights and metrics for styled-bootstrap-grid-sc4
Gathering detailed insights and metrics for styled-bootstrap-grid-sc4
Gathering detailed insights and metrics for styled-bootstrap-grid-sc4
Gathering detailed insights and metrics for styled-bootstrap-grid-sc4
Full Twitter Bootstrap v4 grid system implementation
npm install styled-bootstrap-grid-sc4
Typescript
Module System
Node Version
NPM Version
TypeScript (54.84%)
JavaScript (39.28%)
HTML (3.78%)
CSS (2.04%)
Shell (0.05%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
166 Stars
219 Commits
38 Forks
5 Watchers
31 Branches
11 Contributors
Updated on May 16, 2025
Latest Version
0.0.4
Package Id
styled-bootstrap-grid-sc4@0.0.4
Unpacked Size
460.63 kB
Size
128.40 kB
File Count
44
NPM Version
5.6.0
Node Version
8.11.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
This module is based on the styled-components module.
This module is highly inspired by the awesome work done on the react-bootstrap module.
This module is also based on the Twitter Bootstrap v4.0.0 bootstrap-grid.css
.
The css provided to styled bootstrap grid is not mine.
For more information about how does this grid system works (I mean with classes like containers, row, col, offset, push) , please refer to the official Twitter Bootstrap layout documentation.
npm i -S styled-bootstrap-grid
Bootstrap is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your
<head>
. from Bootstrap documentation
1<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
You also must inject the bootstrap base CSS in your application root file, like this.
1// app.js 2 3import { BaseCSS } from 'styled-bootstrap-grid'; 4 5export default (props) => 6 <Whatever> 7 <BaseCSS /> 8 </Whatever>; 9
You also can inject your own css like this :
1 2import { BaseCSS } from 'styled-bootstrap-grid'; 3 4export default (props) => 5 <Whatever> 6 <BaseCSS css={customCSS} /> 7 </Whatever>;
Basicaly, BaseCSS
takes a string prop, and append the default bootstrap layout base CSS with this string with it.
the defaut bootstrap layout CSS is :
1@-ms-viewport { 2 width: device-width; 3} 4 5html { 6 -webkit-box-sizing: border-box; 7 box-sizing: border-box; 8 -ms-overflow-style: scrollbar; 9} 10 11*, 12*::before, 13*::after { 14 -webkit-box-sizing: inherit; 15 box-sizing: inherit; 16}
1import React from 'react'; 2import { Container, Row, Col } from 'styled-bootstrap-grid'; 3 4export default (props) => 5 <Whatever> 6 <Container> 7 <Row> 8 <Col col xl="1" lg="2" md="3" sm="6"> 9 Hello Bootstrap Layout 10 </Col> 11 </Row> 12 </Container> 13 <Container fluid> 14 <Row> 15 <Col col={6} sm={5} md={4} mdOffset={4}> 16 Hello Bootstrap Fluid Layout 17 </Col> 18 </Row> 19 </Container> 20 </Whatever>;
The package exposes a GridThemeProvider
that allows few custom theming properties. With this provider you can :
Container
padding left and right default valueRow
padding left and right default valueCol
padding left and right default valueThe GridThemeProvider
can be wrapped (or wrapped-in) the styled-component
's ThemeProvider
.
Example :
1import React from 'react'; 2import ReactDOM from 'react-dom'; 3import { GridThemeProvider } from 'styled-bootstrap-grid'; 4import { ThemeProvider } from 'styled-components'; 5 6import App from './whatever/app/folder'; 7 8const gridTheme = { 9 breakpoints: { // defaults below 10 giant: 1200, 11 xl: 1200, 12 desktop: 992, 13 lg: 992, 14 tablet: 768, 15 md: 768, 16 phone: 576, 17 sm: 576, 18 smaller: 575, 19 xs: 575, 20 }, 21 row: { 22 padding: 10, // default 15 23 }, 24 col: { 25 padding: 5, // default 15 26 }, 27 container: { 28 padding: 0, // default 15 29 }, 30}; 31const styledTheme = { 32 mainColor: 'purple', 33} 34 35ReactDOM.render( 36 <ThemeProvider 37 theme={styledTheme} 38 > 39 <GridThemeProvider 40 gridTheme={gridTheme} 41 > 42 <App /> 43 </GridThemeProvider> 44 </ThemeProvider>, 45 document.getElementById('root') 46); 47
This packages also exposes the media
element. It can be used in your styled-components like this :
1import styled from 'styled-components'; 2import { media } from 'styled-bootstrap-grid'; 3 4const CustomDiv = styled.div` 5 color: black; 6 ${media.col` 7 color: orange; 8 `} 9 ${media.phone` 10 color: blue; 11 `} 12 ${media.sm` 13 color: blue; 14 `} 15 ${media.tablet` 16 color: red; 17 `} 18 ${media.md` 19 color: red; 20 `} 21 ${media.desktop` 22 color: purple; 23 `} 24 ${media.lg` 25 color: purple; 26 `} 27 ${media.giant` 28 color: yellow; 29 `} 30 ${media.xl` 31 color: yellow; 32 `} 33`; 34 35export default CustomDiv;
Using this media
object will help you to build media-queries that will fit the same way as Bootstrap do.
name | alias | css generated |
---|---|---|
xs | smaller | all sizes: @media (max-width: 575px) { /* */ } |
sm | phone | @media (min-width: 576px) { /* */ } |
md | tablet | @media (min-width: 768px) { /* */ } |
lg | desktop | @media (min-width: 992px) { /* */ } |
xl | giant | @media (min-width: 1200px) { /* */ } |
props | default | type | description |
---|---|---|---|
gridTheme | undefined | Object | See description below(*) |
(*)
1 2const gridTheme = { 3 breakpoints: { // defaults below 4 giant: 1200, 5 xl: 1200, 6 desktop: 992, 7 lg: 992, 8 tablet: 768, 9 md: 768, 10 phone: 576, 11 sm: 576, 12 smaller: 575, 13 xs: 575, 14 }, 15 row: { 16 padding: 10, // default 15 17 }, 18 col: { 19 padding: 5, // default 15 20 }, 21 container: { 22 padding: 0, // default 15 23 }, 24} 25
props | default | type | description |
---|---|---|---|
fluid | false | boolean | Equivalent to container and container-fluid |
Plus the ones inherited from styled-components div
.
props | default | type | description |
---|---|---|---|
alignItems | undefined | string | start or end or center or baseline or stretch . Equivalent to align-items-{value} |
smAlignItems | undefined | string | start or end or center or baseline or stretch . Equivalent to align-items-sm-{value} |
mdAlignItems | undefined | string | start or end or center or baseline or stretch . Equivalent to align-items-md-{value} |
lgAlignItems | undefined | string | start or end or center or baseline or stretch . Equivalent to align-items-lg-{value} |
xlAlignItems | undefined | string | start or end or center or baseline or stretch . Equivalent to align-items-xl-{value} |
justifyContent | undefined | string | start or end or center or between or around . Equivalent to justify-content-{value} |
smJustifyContent | undefined | string | start or end or center or between or around . Equivalent to justify-content-sm-{value} |
mdJustifyContent | undefined | string | start or end or center or between or around . Equivalent to justify-content-md-{value} |
lgJustifyContent | undefined | string | start or end or center or between or around . Equivalent to justify-content-lg-{value} |
xlJustifyContent | undefined | string | start or end or center or between or around . Equivalent to justify-content-xl-{value} |
Plus the ones inherited from styled-components div
.
props | default | type | description |
---|---|---|---|
col | undefined | number or string or boolean | Goes from 1 to 12. Equivalent to col-* (or col in case of true ) |
offset | undefined | number or string | Goes from 0 to 11. Equivalent to offset-* |
auto | undefined | boolean | Equivalent to col-auto |
alignSelf | undefined | string | auto or start or end or center or baseline or stretch . Equivalent to align-self-{value} |
order | undefined | number or string | first or last or 0 to 12 . Equivalent to order-{value} |
noGutter | undefined | boolean | Equivalent to no-gutter |
sm | undefined | number or string | Goes from 1 to 12. Equivalent to col-sm-* (or col-sm in case of true ) |
smOffset | undefined | number or string | Goes from 0 to 11. Equivalent to offset-sm-* |
smAuto | undefined | boolean | Equivalent to col-sm-auto |
smAlignSelf | undefined | string | auto or start or end or center or baseline or stretch . Equivalent to align-self-sm-{value} |
smOrder | undefined | number or string | first or last or 0 to 12 . Equivalent to order-sm-{value} |
md | undefined | number or string | Goes from 1 to 12. Equivalent to col-md-* (or col-md in case of true ) |
mdOffset | undefined | number or string | Goes from 0 to 11. Equivalent to offset-md-* |
mdAuto | undefined | boolean | Equivalent to col-md-auto |
mdAlignSelf | undefined | string | auto or start or end or center or baseline or stretch . Equivalent to align-self-md-{value} |
mdOrder | undefined | number or string | first or last or 0 to 12 . Equivalent to order-md-{value} |
lg | undefined | number or string | Goes from 1 to 12. Equivalent to col-lg-* (or col-lg in case of true ) |
lgOffset | undefined | number or string | Goes from 0 to 11. Equivalent to offset-lg-* |
lgAuto | undefined | boolean | Equivalent to col-lg-auto |
lgAlignSelf | undefined | string | auto or start or end or center or baseline or stretch . Equivalent to align-self-lg-{value} |
lgOrder | undefined | number or string | first or last or 0 to 12 . Equivalent to order-lg-{value} |
xl | undefined | number or string | Goes from 1 to 12. Equivalent to col-xl-* (or col-xl in case of true ) |
xlOffset | undefined | number or string | Goes from 0 to 11. Equivalent to offset-xl-* |
xlAuto | undefined | boolean | Equivalent to col-xl-auto |
xlAlignSelf | undefined | string | auto or start or end or center or baseline or stretch . Equivalent to align-self-xl-{value} |
xlOrder | undefined | number or string | first or last or 0 to 12 . Equivalent to order-xl-{value} |
Plus the ones inherited from styled-components div
.
To run the example
styled-bootstrap-grid
's dependencies with npm i
npm run build:watch
example
's directory with cd <styled-bootstrap-grid folder path>/example
example
's dependencies with yarn
yarn start
Any othre idea ? Please leave a suggestion.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 7/20 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
105 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More