React: CSS in JS techniques comparison.
Inside each package folder, run:
npm i
npm run build && open index.html
How to read the table
More ticks doesn't mean "better", it depends on your needs. For example, if a package supports the css file extraction you can run the autoprefixing at build time.
Package | Version | Automatic Vendor Prefixing | Pseudo Classes | Media Queries | Styles As Object Literals | Extract CSS File | Package Stats |
---|---|---|---|---|---|---|---|
aphrodite | 1.2.3 | ✓ | ✓ | ✓ | ✓ | ✓ | info 63/133 download 358,386 |
babel-plugin-css-in-js | 1.2.2 | ✓ | ✓ | ✓ | ✓ | ✓ | info 6/12 download 408 |
babel-plugin-pre-style | 1.0.9-alpha | ✓ | ✓ | ✓ | ✓ | info 6/12 download 408 |
|
bloody-react-styled | 3.0.0 | ✓ | ✓ | info 1/2 download 12 |
|||
classy | 0.3.0 | ✓ | ✓ | ✓ | info 0/0 download 88 |
||
csjs | 1.0.0 | ✓ | ✓ | info 22/25 download 1,827 |
|||
css-constructor | 0.1.1 | ✓ | ✓ | ✓ | info 4/2 download 65 |
||
css-light | 1.1.0 | ✓ | ✓ | ✓ | ✓ | info 1/0 download 54 |
|
css-loader | 0.15.6 | ✓ | ✓ | ✓ | info 59/496 download 7,442,704 |
||
css-ns | 1.0.0 | ✓ | ✓ | ✓ | info 1/1 download 313 |
||
cssobj | 0.2.21 | ✓ | ✓ | ✓ | ✓ | info 2/12 download 205 |
|
cssx | 3.8.0 | ✓ | ✓ | ✓ | ✓ | info 10/14 download 314 |
|
cxs | 6.2.0 | ✓ | ✓ | ✓ | ✓ | info 18/20 download 2,940 |
|
electron-css | 0.6.0 | ✓ | ✓ | ✓ | info 0/0 download 135 |
||
emotion | 6.0.3 | ✓ | ✓ | ✓ | ✓ | ✓ | info 73/306 download 260,249 |
es-css-modules | 1.2.3 | ✓ | ✓ | ✓ | info 1/2 download 116 |
||
freestyler | 1.5.0 | ✓ | ✓ | ✓ | ✓ | info 12/0 download 212 |
|
glamor | 2.1.0 | ✓ | ✓ | ✓ | ✓ | ✓ | info 79/206 download 842,621 |
glamorous | 4.12.5 | ✓ | ✓ | ✓ | ✓ | ✓ | info 1/183 download 795,853 |
hyperstyles | 3.3.0 | ✓ | ✓ | ✓ | info 0/3 download 51 |
||
i-css | 1.0.4 | ✓ | ✓ | ✓ | ✓ | info 0/0 download 52 |
|
j2c | 0.10.0 | ✓ | ✓ | ✓ | ✓ | info 8/24 download 613 |
|
jsxstyle | 2.1.1 | ✓ | ✓ | ✓ | ✓ | info 12/75 download 3,174 |
|
linaria | 0.5.0 | ✓ | ✓ | ✓ | ✓ | ✓ | info 21/62 download 349 |
nano-css | 0.1.0 | ✓ | ✓ | ✓ | ✓ | ✓ | info 15/3 download 682 |
pre-style | 1.0.9-alpha | ✓ | ✓ | ✓ | info 4/3 download 16 |
||
radium | 0.13.5 | ✓ | ✓ | ✓ | ✓ | info 84/475 download 857,067 |
|
react-css-builder | 0.2.0 | ✓ | info 0/0 download 5 |
||||
react-css-components | 0.6.9 | ✓ | ✓ | ✓ | info 5/9 download 40 |
||
react-css-modules | 3.0.2 | ✓ | ✓ | ✓ | info 47/152 download 172,299 |
||
react-cssom | 1.0.0 | ✓ | ✓ | ✓ | info 0/0 download 5 |
||
react-fela | 2.1.0 | ✓ | ✓ | ✓ | ✓ | ✓ | info 18/274 download 24,191 |
react-free-style | 0.6.0 | ✓ | ✓ | ✓ | ✓ | info 0/19 download 154 |
|
react-inline-css | 1.2.0 | ✓ | ✓ | info 6/12 download 10,718 |
|||
react-inline-style | 0.1.0 | ✓ | ✓ | ✓ | ✓ | info 1/0 download 4 |
|
react-inline | 0.6.3 | ✓ | ✓ | ✓ | ✓ | ✓ | info 3/0 download 121 |
react-jss | 2.0.5 | ✓ | ✓ | ✓ | ✓ | ✓ | info 17/180 download 431,995 |
react-look | 0.6.1 | ✓ | ✓ | ✓ | ✓ | info 14/0 download 77 |
|
react-native-web | 0.0.11 | ✓ | ✓ | ✓ | info 21/739 download 51,794 |
||
react-statics-styles | 3.0.2 | ✓ | ✓ | ✓ | info 0/0 download 12 |
||
react-styl | 0.0.1 | ✓ | ✓ | info 0/0 download 62 |
|||
react-style | 0.5.5 | ✓ | ✓ | ✓ | info 34/65 download 1,500 |
||
react-styleable | 1.4.0 | ✓ | ✓ | ✓ | info 1/5 download 1,087 |
||
react-stylematic | 1.0.1 | ✓ | ✓ | ✓ | ✓ | ✓ | info 1/0 download 1,957 |
react-theme | 0.1.4 | ✓ | info 0/0 download 483 |
||||
react-vstyle | 0.1.0 | ✓ | ✓ | ✓ | ✓ | ✓ | info 0/0 download 6 |
reactcss | 0.3.2 | ✓ | ✓ | info 4/43 download 545,864 |
|||
restyles | 2.0.1 | ✓ | ✓ | ✓ | ✓ | info 1/1 download 17 |
|
scope-styles | 0.6.0 | ✓ | ✓ | ✓ | ✓ | info 7/6 download 1,354 |
|
smart-css | 1.1.1 | ✓ | ✓ | ✓ | info 4/3 download 12 |
||
stile ___________________________ react-media-queries |
2.0.0 | ✓ | ✓ | ✓ | info 1/3 download 21 ____________ info 1/2 download 22 |
||
stilr | 1.1.0 | ✓ | ✓ | ✓ | ✓ | info 5/18 download 148 |
|
stylable | 5.0.2 | ✓ | ✓ | ✓ | info 62/114 download 9,275 |
||
style-it | 1.2.9 | ✓ | ✓ | info 1/25 download 2,686 |
|||
styled-components | 3.2.6 | ✓ | ✓ | ✓ | info 104/1092 download 1,085,338 |
||
styled-jsx | 0.0.7 | ✓ | ✓ | ✓ | ✓ | info 21/284 download 186,617 |
|
styletron-react | 2.1.2 | ✓ | ✓ | ✓ | ✓ | ✓ | info 59/82 download 5,709 |
styling | 0.2.0 | ✓ | ✓ | ✓ | info 5/2 download 49 |
||
superstyle | 1.0.0-1 | ✓ | info 0/1 download 5 |
||||
@thi.ng/hiccup-css | 0.2.0 | ✓ | ✓ | ✓ | ✓ | ✓ | info 5/14 download 537 |
typestyle | 0.22.3 | ✓ | ✓ | ✓ | ✓ | info 15/151 download 23,530 |
|
uranium | 0.1.2 | ✓ | ✓ | info 3/6 download 6 |
This list has been auto-updated (?) on August 8, 2018
"Wow, this totally makes my week!" - Dan Abramov
"nice compilation of css-in-js techniques" - TJ Holowaychuk
SurviveJS / Styling React by Juho Vepsäläinen
The Case for CSS Modules by Mark Dalgleish
First Class Styles by Mark Dalgleish
Styling React.JS applications by Max Stoiber
If your package is not listed here, feel free to add it.
- Create a new folder named
package-name
in the root folder. - Implement the red button example using the package.
- Add a new entry to data.json.
- Rename
ReadmeSrc/.env_example
toReadmeSrc/.env
and set a Github access token to retrieve data from Github. - Re-generate the data with:
cd ReadmeSrc && yarn && yarn update-data && yarn generate-readme
.