All Projects → buildo → React Flexview

buildo / React Flexview

Licence: mit
A powerful React component to abstract over flexbox and create any layout on any browser

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Flexview

flexboxes
CSS flexbox framework with pure flexbox grid ability
Stars: ✭ 27 (-90.22%)
Mutual labels:  flex, grid, layout, flexbox
React Native Responsive Grid
Bringing the Web's Responsive Design to React Native
Stars: ✭ 369 (+33.7%)
Mutual labels:  layout, grid, flexbox
Flex Layout
Provides HTML UI layout for Angular applications; using Flexbox and a Responsive API
Stars: ✭ 5,705 (+1967.03%)
Mutual labels:  layout, grid, flexbox
React Flexa
Responsive React Flexbox (CSS Flexible Box Layout Module) grid system based heavily on the standard CSS API.
Stars: ✭ 120 (-56.52%)
Mutual labels:  flex, grid, flexbox
Flexible Grid
Flexible grid layouts to get you familiar with building within the flexible grid system.(HTML, CSS, SASS, SCSS)
Stars: ✭ 154 (-44.2%)
Mutual labels:  flex, grid, flexbox
vue-layout-system
A pack of Vue components that solve daily layout problems
Stars: ✭ 31 (-88.77%)
Mutual labels:  flex, grid, layout
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+653.26%)
Mutual labels:  layout, grid, flexbox
Katana
Katana is CSS Layout System made with Flexbox
Stars: ✭ 57 (-79.35%)
Mutual labels:  flex, grid, flexbox
Core Layout
Flexbox & CSS-style Layout in Swift.
Stars: ✭ 215 (-22.1%)
Mutual labels:  flex, layout, flexbox
griding
🧱 lean grid & responsive for react
Stars: ✭ 18 (-93.48%)
Mutual labels:  grid, layout, flexbox
gymnast
🤸 Configurable grid and layout engine for React
Stars: ✭ 35 (-87.32%)
Mutual labels:  grid, layout, flexbox
fortune
🔮Fortune is your friendly CSS properties framework.
Stars: ✭ 16 (-94.2%)
Mutual labels:  grid, flexbox
CSS-Grid
CSS Grid 레이아웃 모듈 Level 1
Stars: ✭ 21 (-92.39%)
Mutual labels:  grid, layout
gutter-grid
A Sass flexbox based grid system that is able to replicate CSS grid-gap in IE11
Stars: ✭ 18 (-93.48%)
Mutual labels:  grid, flexbox
grid-layout
grid-layout is a layout engine which implements grid, can use in canvas/node-canvas
Stars: ✭ 43 (-84.42%)
Mutual labels:  grid, layout
angular-bricklayer
AngularJS module for ademilter's bricklayer, a lightweight & independent cascading grid layout library
Stars: ✭ 42 (-84.78%)
Mutual labels:  grid, layout
VueFlex
A flexbox grid system.
Stars: ✭ 13 (-95.29%)
Mutual labels:  flex, grid
Fluid-Grid
Fluid, Responsive and Semantic grid for Sass (SCSS) or LESS CSS. Supports any number of columns. Gutter width is defined as percentage, and grids can be nested too.
Stars: ✭ 17 (-93.84%)
Mutual labels:  grid, layout
ReactSimpleFlexGrid
A way to quickly add a Grid Layout to your React app 🚀
Stars: ✭ 185 (-32.97%)
Mutual labels:  grid, flexbox
flexbin
Pure CSS, flexible and gapless image gallery layout like Google Images and 500px.com
Stars: ✭ 93 (-66.3%)
Mutual labels:  layout, flexbox

FlexView

A powerful React component to abstract over flexbox and create any layout on any browser.

Install

yarn add react-flexview

Why

The flexbox API is powerful but far from being perfect. The API is complex and there are still many inconsistencies between browsers that force developers to overuse vendor prefixes and literally do magic tricks to achieve the desired layout.

For these reasons, we asked ourselves: is there a way to simplify the API and handle any browser inconsistency in a single place? Our attempt to answer "yes!" to that question gave birth to FlexView.

// flex row
<FlexView />

// flex column
<FlexView column />

// grow, shrink and basis
<FlexView grow shrink basis={100} />
<FlexView grow={2} shrink={1} basis='auto' />
<FlexView basis={100} /> // shrink is set to `false` by default so you're certain to a have it `100px` wide/tall

// wrap
<FlexView wrap />

Remember how difficult it was to center a div inside another div? flexbox definitely improved it, but still having to switch from align-items to justify-content based on flex-direction of the parent is confusing and error prone.

FlexView lets you align and center children with two intuitive props: vAlignContent and hAlignContent.

<FlexView hAlignContent='center' vAlignContent='center'>
  <FlexView>the center of the Earth</FlexView>
</FlexView>

How to use

In your component:

import React from 'react';
import FlexView from 'react-flexview';

export default class Component extends React.Component {
  render() {
    return (
      <FlexView vAlignContent='center'>
        I'm vertically centered!
      </FlexView>
    );
  }
}

Props

Name Type Default Description
children ReactChildren required. FlexView content
column Boolean optional. Flex-direction: column
vAlignContent enum("top" | "center" | "bottom") optional. Align content vertically
hAlignContent enum("left" | "center" | "right") optional. Align content horizontally
marginLeft union(String | Number) optional. Margin-left property ("auto" to align self right)
marginTop union(String | Number) optional. Margin-top property ("auto" to align self bottom)
marginRight union(String | Number) optional. Margin-right property ("auto" to align self left)
marginBottom union(String | Number) optional. Margin-bottom property ("auto" to align self top)
grow union(Boolean | Number) optional. Property (for parent primary axis)
shrink union(Boolean | Number) optional. Flex-shrink property
basis union(String | Number) optional. Flex-basis property
wrap Boolean optional. Wrap content
height union(String | Number) optional. Height property (for parent secondary axis)
width union(String | Number) optional. Width property (for parent secondary axis)
className String optional. Additional className for wrapper element
style Object optional. Inline-style overrides for wrapper element

Demo

Here's a live playground

Documentation

Refer to the Book of FlexView

Supported browsers

We removed vendor prefixes in #66, since than we only supports browsers that don't require prefixes for flexbox CSS properties which are most browsers:

  • IE 11
  • Edge (any version)
  • Google Chrome 29+
  • Firefox 28+
  • Safari 9+

If you need to support older browsers, try with FlexView 3.x.

Used By

At buildo we've been using FlexView in production in every web application we built since July 2015 (it was in a different repo back then).

As of today, FlexView has replaced the div as the brick of our projects and, thanks to it, our developers can finally build without too much trouble complex layouts that work the same on Chrome, Firefox, Safari and Internet Explorer 11.

You can see it in action here:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].