Lightweight Flex Component For React
npm install --save reactrix-flex
yarn add reactrix-flex
import React, { Component } from 'react'
import ReactrixFlex from 'reactrix-flex'
class Flex extends Component {
render () {
const options = {
breakPoints: [ 640, 900, 1200 , 1400],
rowItems: [ 2, 3, 4, 5]
}
return (
<ReactrixFlex {...options}>
<div>Flex Item</div>
<div>Flex Item</div>
</ReactrixFlex>
)
}
}
- Only two peer depencies (react/prop-types) ✔️
- Works great on all devices/browsers ✔️
- Easy to use BEM class hooks ✔️
Prop | Type | Default | Description: Options |
---|---|---|---|
breakPoints |
array | [ 600, 900, 1280] |
Screen width: number
|
rowItems |
array | [ 2, 3, 4 ] |
Item count: number
|
Class | Description |
---|---|
.flex |
Outer component wrapper |
.flex__cotainer |
Inner component wrapper |
.flex__item |
Item outer wrapper |
.flex__content |
Item inner wrapper |
Follow these steps to setup a local development environment. Use yarn or npm - not both.
- Clone the repo from Github
git clone https://github.com/alexcasche/react-sidebar
- Setup project & start rollup watch
npm install && npm start
yarn install && yarn add
- Setup react app & start dev server
cd example
npm install && npm start
yarn install && yarn start
Interested in publishing your own packages? Checkout create-react-library 🙌
MIT © alexcasche