You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

github.com/trendmicro-frontend/react-grid-system

Package Overview
Dependencies
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/trendmicro-frontend/react-grid-system

Source
Go Modules
Version
v0.1.0
Version published
Created
Source

react-grid-system build status Coverage Status

NPM

React Grid System component

Demo: https://trendmicro-frontend.github.io/react-grid-system

Installation

  • Install the latest version of react and react-grid-system:
npm install --save react @trendmicro/react-grid-system
  • At this point you can import @trendmicro/react-grid-system and its styles in your application as follows:
import {
    Provider as GridSystemProvider,
    Container,
    Row,
    Col
} from '@trendmicro/react-grid-system';

// Be sure to include styles at some point, probably during your bootstraping
import '@trendmicro/react-grid-system/dist/react-grid-system.css';

Create a common components directory including the GridSystem component, as shown below:

components/
  GridSystem/
    index.js

components/GridSystem/index.js

import '@trendmicro/react-grid-system/dist/react-grid-system.css';
export {
    Provider,
    Container,
    Row,
    Col
} from '@trendmicro/react-grid-system';

Then, import components like below:

import {
    Provider as GridSystemProvider,
    Container,
    Row,
    Col
} from './components/GridSystem';

Usage

<Container fluid gutterWidth={20}>
    <Row>
        <Col xs md={8}>col-md-8</Col>
        <Col width={6} md={4}>col-6 col-md-4</Col>
    </Row>
    <Row>
        <Col width={6} md={4}>col-6 col-md-4</Col>
        <Col width={6} md={4}>col-6 col-md-4</Col>
        <Col width={6} md={4}>col-6 col-md-4</Col>
    </Row>
    <Row>
        <Col width={6}>col-6</Col>
        <Col width={6}>col-6</Col>
    </Row>
</Container>

Provider

You can wrap <Container />, <Row />, and <Col /> in <Provider /> to pass grid system config through context.

<Provider
    breakpoints={[576, 768, 992, 1200]}
    containerWidths={[540, 720, 960, 1140]}
    columns={12}
    gutterWidth={20}
    layout="flexbox"
>
    <Container>
        <Row>
            <Col>col</Col>
            <Col>col</Col>
            <Col>col</Col>
        </Row>
    </Container>
    <Container>
        <Row>
            <Col>col</Col>
            <Col>col</Col>
        </Row>
    </Container>
</Provider>

API

Properties

Provider

NameTypeDefaultDescription
breakpointsNumber[][576, 768, 992, 1200, 0]The breakpoints (minimum width) of devices in screen class sm, md, lg, xl, and xxl.
containerWidthsNumber[][540, 720, 960, 1140, 0]The container widths in pixels of devices in screen class sm, md, lg, xl, and xxl.
columnsNumber12The number of columns.
gutterWidthNumber30The horizontal padding (called gutter) between two columns. A gutter width of 30 means 15px on each side of a column.
layoutOne of:
'floats'
'flexbox'
'floats'The grid system layout.

Container

NameTypeDefaultDescription
fluidBooleanfalseTrue makes the container full-width, false fixed-width.
xsBooleanfalseTrue makes container fluid only in xs, not present means fluid everywhere.
smBooleanfalseTrue makes container fluid only in sm, not present means fluid everywhere.
mdBooleanfalseTrue makes container fluid only in md, not present means fluid everywhere.
lgBooleanfalseTrue makes container fluid only in lg, not present means fluid everywhere.
xlBooleanfalseTrue makes container fluid only in xl, not present means fluid everywhere.
xxlBooleanfalseTrue makes container fluid only in xxl, not present means fluid everywhere.
columnsNumber12The number of columns.
gutterWidthNumber30The horizontal padding (called gutter) between two columns. A gutter width of 30 means 15px on each side of a column.
layoutOne of:
'floats'
'flexbox'
'floats'The grid system layout.
onResizeFunction({ screenClass })A callback fired when the resize event occurs.

Row

NameTypeDefaultDescription
columnsNumber12The number of columns.
gutterWidthNumber30The horizontal padding (called gutter) between two columns. A gutter width of 30 means 15px on each side of a column.
layoutOne of:
'floats'
'flexbox'
'floats'The grid system layout.

Col

NameTypeDefaultDescription
widthNumber or 'auto'The width of the column for all screen classes.
xsBoolean, Number or 'auto'The width of the column for screen class xs.
smBoolean, Number or 'auto'The width of the column for screen class sm.
mdBoolean, Number or 'auto'The width of the column for screen class md.
lgBoolean, Number or 'auto'The width of the column for screen class lg.
xlBoolean, Number or 'auto'The width of the column for screen class xl.
xxlBoolean, Number or 'auto'The width of the column for screen class xxl.
offset{ xs, sm, md, lg, xl, xxl }The offset of this column for all screen classes.
pull{ xs, sm, md, lg, xl, xxl }The amount this column is pulled to the left for all screen classes.
push{ xs, sm, md, lg, xl, xxl }The amount this column is pushed to the right for all screen classes.

License

MIT

FAQs

Package last updated on 08 Feb 2018

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