1.0.7 • Published 3 years ago

@nathansearles/react-flex-grid v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

React Flex Grid

:fire: In active development :fire:

A simple React based grid system using flex. Uses 12 columns based on the 8px grid system.

To do

  • Examples website
  • Project level config
  • Testing
  • Refine docs

Examples

React Flex Grid Examples

Installation

@nathansearles/react-flex-grid

#Yarn
yarn add @nathansearles/react-flex-grid

#NPM
npm install @nathansearles/react-flex-grid

Column

PropDescriptionKeysValuesTypes
columnsDefine columns by breakpointxs, sm, md, lg, xl, xxl1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'auto'string:string\|number
offsetsDefine offsets by breakpointxs, sm, md, lg, xl, xxl1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12string:number
orderingDefine ordering by breakpointxs, sm, md, lg, xl, xxlany numberstring:number

Examples

Columns

<Column columns={{ xs: 12, md: 10, xl: 8 }}>Lorem ipsum...</Column>

Offsets

<Column offsets={{ xs: 1, md: 2, xl: 4 }}>Lorem ipsum...</Column>

Ordering

<Column ordering={{ xs: 1, md: 2, xl: 1 }}>Lorem ipsum...</Column>

Row

PropDescriptionKeysValuesTypes
justifyDefine justification by breakpointxs, sm, md, lg, xl, xxl"normal", "start", "center", "end"string:string
alignDefine alignment by breakpointxs, sm, md, lg, xl, xxl"normal", "start", "center", "end"string:string
spacingDefine gutter spacing * 8px by breakpointxs, sm, md, lg, xl, xxl0 , 1 , 2 , 3 , 4string:number

Examples

Justify

<Row justify={{ xs: 'center', md: 'start', xl: 'end' }}>Lorem ipsum...</Row>

Align

<Row align={{ xs: 'center', md: 'start', xl: 'end' }}>Lorem ipsum...</Row>

Spacing

<Row align={{ xs: 'center', md: 'start', xl: 'end' }}>Lorem ipsum...</Row>

Simple example

import { Container, Row, Column } from '@nathansearles/react-flex-grid';

function App() {
  return (
    <Container>
      <Row>
        <Column columns={{ xs: 12, md: 6, lg: 4 }}>
          <h2>Lorem ipsum dolor sit amet...</h2>
        </Column>
        <Column columns={{ xs: 12, md: 6, lg: 4 }}>
          <h2>Lorem ipsum dolor sit amet...</h2>
        </Column>
      </Row>
    </Container>
  );
}
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago