An open API service indexing awesome lists of open source software.

https://github.com/codingzeal/cellulose

[DEPRECATED] React Flexible Contextual Layout Components
https://github.com/codingzeal/cellulose

Last synced: 12 months ago
JSON representation

[DEPRECATED] React Flexible Contextual Layout Components

Awesome Lists containing this project

README

          

# `DEPRECATED`

## End of Life

Cellulose was created as an experiment in layouts that was never fully realized. With evolving conventions in CSS, we are choosing to deprecate this project, as we no longer feel that it is the right solution for layout problems.

---

![Alt text](docs/images/cellulose-logo.png)

# Cellulose

[![GitHub issues](https://img.shields.io/github/issues/bmatto/cellulose.svg)](https://github.com/bmatto/cellulose/issues)
[![CircleCI](https://img.shields.io/circleci/project/github/bmatto/cellulose.svg)]()
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/bmatto/cellulose/master/LICENSE)

Cellulose is a React layout library that allows you to create contextually aware components using flexbox.

The `` component uses its own rendered width to assign style and responsive behavior, rather than the width of the browser window.

## Installation

`npm i -S cellulose` or `yarn add cellulose`

## Usage

Use the `` component to define a container that you want to style based on internal width.

`` will render into the DOM as a `

` whose class is determined by which breakPoint in `breakPoints` its own width exceeds.

```jsx
import { Cellulose } from 'cellulose'
import React from 'react'

export function MyComponent() {
const breakPoints = {
768: 'greater-than-768',
1024: 'greater-than-1024'
}

return (

Content


)
}
```

Cellulose can also be used to create a responsive grid. Use the prop `columns=` of `` to define the number of columns to use, then add `` components with `spanOptions` props that define responsive behavior

```jsx
import { Cellulose, Cell } from 'cellulose'
import React from 'react'

export function MyComponent() {
const breakPoints = {
768: 'greater-than-768',
1024: 'greater-than-1024'
}

return (


One



Two



)
}
```

Cellulose's `` components can even configure their own classes based on which `breakPoints` are activated!

```jsx
import { Cellulose, Cell } from 'cellulose'
import React from 'react'

export function MyComponent() {
const breakPoints = {
768: 'greater-than-768',
1024: 'greater-than-1024'
}

return (


Menu-ish Stuff



Body Content



)
}
```