Skip to content

Instantly share code, notes, and snippets.

@pdf
pdf / example.jsx
Last active December 9, 2017 02:06
Trivial implementation of a responsive grid system using Flexbox and redux-responsive
import { Flex, Box } from './flexbox.jsx';
// A basic example. Note that the number of grid columns is not fixed,
// instead you simply specify sizes as fractions (or decimals between
// 0.0 and 1.0), and the items will be sized appropriately. For example,
// the outer <Flex/> is full size at the `xs` breakpoint, 2/3 of full size
// at the `md` breakpoint, and 1/2 at `lg` or higher.
export const Basic (props) => (
<Flex xs={1} md={2 / 3} lg={1 / 2} auto >
<Box auto />