Responsive style tools for ReactJS
npm i @entria/responsiveness --save
yarn add @entria/responsiveness
You can define the sizes with their specifics props (small
, medium
, large
).
import React from 'react';
import { Grid } from '@entria/responsiveness';
const Example = () => (
<Grid.Row>
<Grid.Col large={3} medium={6}>1</Grid.Col>
<Grid.Col large={3} medium={6}>2</Grid.Col>
<Grid.Col large={3} medium={6}>3</Grid.Col>
<Grid.Col large={3} medium={6}>4</Grid.Col>
</Grid.Row>
);
export default Example;
Or with the sizes
prop (The parameters is from smaller to greater breakpoints).
import React from 'react';
import { Grid } from '@entria/responsiveness';
const Example = () => (
<Grid.Row>
<Grid.Col sizes={[12, 6, 3]}>1</Grid.Col>
<Grid.Col sizes={[12, 6, 3]}>2</Grid.Col>
<Grid.Col sizes={[12, 6, 3]}>3</Grid.Col>
<Grid.Col sizes={[12, 6, 3]}>4</Grid.Col>
</Grid.Row>
);
export default Example;
Author: entria
Source Code: https://github.com/entria/responsiveness
#reactjs #react #javascript