• Stars
    star
    162
  • Rank 225,417 (Top 5 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React flexbox implementation

React-flexbox

Implementation of css flexbox in react with inline styles. It is written in ES6 and requires an ES6 to ES5 transpiler. If there is need for it I can add a transpiled version to the repo.

API

Install

npm install react-flexbox --save
yarn add react-flexbox
const View = require('react-flexbox')
// or
import View from 'react-flexbox'

UMD

Module exposed as ReactFlexbox

<script src="https://unpkg.com/react-flexbox/dist/react-flexbox.js"></scrip>
const View = ReactFlexbox.default

Components

View

A flex view element that can be used instead of FlexRow or FlexColumn

This is default import.

Some simple examples:

<View row>
  <View auto row>
    <View column width="100px"><View className="red">Left</View></View>
    <View column width="100px"><View className="red">Left</View></View>
  </View>
  <View row className="green">All the place in the world</View>
</View>
<View column height="200px">
  <View column auto>
    <View className="green" height="20px">Green</View>
    <View className="red" height="20px">Red</View>
  </View>
  <View className="green">De rest</View>
</View>

Props

All props are optional and can be set on both components.

row

boolean, sets the flexDirection to row

column

boolean, sets the flexDirection to column

auto

boolean, sets flex to '0 0 auto'

className

must be a string

height

height must be a string with a valid css unit.

style

Will be merged the flex style. This allows you to override the style.

width

width can be either a number width={2}, this acts as flex-grow or a string with a unit (for example % or px) - it must be a valid css unit.

FlexRow

deprecated

A flex row. This is a View with prop row

FlexColumn

deprecated

A flex column This is a View with prop column

Examples

See examples

To run, make sure the devDependencies are installed and run npm run example, after that surf to http://localhost:8080/webpack-dev-server/

More Repositories

1

image-webpack-loader

Image loader module for webpack
JavaScript
2,035
star
2

react-es6-browserify

Boilerplate for react, ES6 and browserify
JavaScript
147
star
3

ga-react-router

Google analytics component for react-router
JavaScript
54
star
4

bucklescript-tea-starter-kit

Starter kit for bucklescript with the elm architecture
OCaml
51
star
5

samegame

Implementation of the qml samegame tutorial in Go (http://qt-project.org/doc/qt-5.1/qtquick/tutorials-samegame-samegame1.html)
Go
47
star
6

boilerplate-webpack-react

Boilerplate project for Reactjs with webpack, gulp and stylus
JavaScript
45
star
7

elm-css-webpack-loader

JavaScript
34
star
8

markdown-react

React markdown builder
JavaScript
19
star
9

dream-channels

Phoenix (Elixir) like channels for Dream (Ocaml)
JavaScript
15
star
10

dream-melange-tea-tailwind

Standard ML
15
star
11

angular-picasa

Angular Picasa directive and service
JavaScript
9
star
12

game-of-life-bucklescript

Port of my game of life elm implementation to bucklescript with a pixi.js renderer
JavaScript
7
star
13

game-of-life

Game Of Life implementation in Elm
JavaScript
5
star
14

knobster

Clone of https://gitlab.com/MazeChaZer/knobster implemented at SocratesBe
OCaml
3
star
15

rocket_man

Playing with nerves and the dotstar ledstrip
Elixir
3
star
16

network-monitor-plasmoid

a plasmoid to monitor your available download and upload quota
Python
2
star
17

musictagger

a basic python music tagger
Python
2
star
18

knobster-fsharp-elmish

ported the ocaml example to f# in 30 minutes
F#
2
star
19

bloated-clock-plasmoid

a plasmoid clock with many options written in python
Python
2
star
20

emacs-config

my emacs config
Emacs Lisp
2
star
21

bank-kata-ocaml

OCaml
1
star
22

adventofcode2018

OCaml
1
star
23

elm-maze

Elm Maze
Elm
1
star
24

elm-langton-s-ant

Elm
1
star
25

trenches

2d js + elixir game for socrates
Elixir
1
star
26

elm-connect4

connect4 in elm
Elm
1
star
27

OGA

oga
1
star
28

adventofcode2017

OCaml
1
star
29

bucklescript-fractal-tree

JavaScript
1
star