UNPKG

4.34 kBMarkdownView Raw
1
2# Rebass
3
4React UI component library & design system,
5built with [styled-system][system],
6with support for
7[styled-components][sc] & [emotion][emotion].
8
9[![Build Status][badge]][travis]
10[![Coverage][coverage-badge]][coverage]
11[![Downloads][downloads-badge]][npm]
12[![Version][version-badge]][npm]
13
14[badge]: https://img.shields.io/travis/rebassjs/rebass.svg?style=flat-square
15[travis]: https://travis-ci.org/rebassjs/rebass
16[coverage-badge]: https://img.shields.io/codecov/c/github/rebassjs/rebass.svg?style=flat-square
17[coverage]: https://codecov.io/github/rebassjs/rebass
18
19[downloads-badge]: https://img.shields.io/npm/dw/rebass.svg?style=flat-square
20[version-badge]: https://img.shields.io/npm/v/rebass.svg?style=flat-square
21[npm]: https://npmjs.com/package/rebass
22
23https://rebassjs.org
24
25**Docs for v2:**: https://rebass-v2.now.sh
26
27```sh
28npm i rebass
29```
30
31Rebass is a library of highly-composable, primitive UI components for React,
32built with styled-components to keep styles isolated and reduce the need to write custom CSS in your application.
33Based upon a configurable design system,
34Rebass‘s props API makes building consistent, responsive web apps simpler and faster.
35
36
37## Getting Started
38
39```jsx
40import React from 'react'
41import { Provider, Heading, Button } from 'rebass'
42
43const App = props => (
44 <Provider>
45 <Heading>Hello</Heading>
46 <Button>Rebass</Button>
47 </Provider>
48)
49```
50
51To use Rebass with [emotion][emotion], import from `rebass/emotion`:
52
53```js
54import * as Rebass from 'rebass/emotion'
55```
56
57## Features
58
59- Kickstart your own React component library
60- Responsive style props from [styled-system][system]
61- Flexbox grid with [Rebass Grid][]
62- Support for [styled-components][sc] & [emotion][emotion]
63- Functional stateless UI components
64- Configurable theming
65- Extensible base components
66- Design-system based consistency
67- Built for responsive web design
68
69
70> "One of the best React component libs out there"
71> – [Max Stoiber](https://twitter.com/mxstbr/status/882657561111080960)
72
73> "Rebass is the Bootstrap of React."
74> – [Jori Lallo](https://twitter.com/jorilallo/status/882990343225868289)
75
76> "A whopper component library built on styled-components. Responsive, systematic, scalable...the business!"
77> – [Colm Tuite](https://twitter.com/colmtuite/status/882715087936606210)
78
79
80## Documentation
81
82- [Docs](https://rebassjs.org)
83- [Getting Started](https://rebassjs.org/getting-started)
84- [Props](https://rebassjs.org/props)
85- [Grid System](https://rebassjs.org/grid-system)
86- [Theming](https://rebassjs.org/theming)
87- [Extending](https://rebassjs.org/extending)
88- [Components](https://rebassjs.org/components)
89- [Server-Side Rendering](https://rebassjs.org/server-side-rendering)
90
91## CodeSandbox
92
93Try it out:
94
95https://codesandbox.io/s/github/rebassjs/rebass/tree/master/examples/sandbox
96
97### Architectural Approach
98
99Rebass is built around a component architectural approach inspired by Dan Abramov’s
100[Presentational and Container Components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0#.ah4312963),
101where presentational components are the only ones that encapsulate styles and contain no application logic,
102and container components do not contain any styles or DOM markup and handle all the application logic.
103
104Rebass only contains presentational components,
105which means controlling things like progressive disclosure mechanisms
106or dropdown menus should be handled at a higher level in container components.
107Therefore, Rebass itself does not require any client-side JavaScript,
108is well suited to server-side rendering,
109and can fit into virtually any higher level application architecture.
110
111See [Patterns for Style Composition in React](http://jxnblk.com/writing/posts/patterns-for-style-composition-in-react/)
112for more on some of the thought behind Rebass.
113
114
115### Related
116
117- [styled-system][system]
118- [Rebass Grid][]
119- [styled-components][sc]
120- [emotion][emotion]
121
122[system]: https://github.com/jxnblk/styled-system
123[Rebass Grid]: https://github.com/rebassjs/grid
124[sc]: https://github.com/styled-components/styled-components
125[emotion]: https://github.com/emotion-js/emotion
126
127#### v1.0.7
128
129For the previous version of Rebass see the [v1.0.7](https://github.com/rebassjs/rebass/tree/v1.0.7) branch.
130
131---
132
133[Contributing](.github/CONTRIBUTING.md)
134|
135[MIT License](.github/LICENSE.md)
136