Skip to content

Commit 8b90e6f

Browse files
rasmuseriktimneutkens
authored andcommitted
example: with react-toolbox (vercel#2047)
* example with react-toolbox * JavaScript standard
1 parent 1723d9d commit 8b90e6f

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed

examples/with-react-toolbox/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-react-toolbox)
2+
3+
# With react-toolbox example
4+
5+
## How to use
6+
7+
Download the example [or clone the repo](https://github.com/zeit/next.js):
8+
9+
```bash
10+
curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-react-toolbox
11+
cd with-react-toolbox
12+
```
13+
14+
Install it and run:
15+
16+
```bash
17+
yarn
18+
yarn dev
19+
```
20+
21+
Notice that `yarn toolbox` (or `npm run toolbox`) should be rerun every time the `"reactToolbox"` configuration in `package.json` is changed, in order to update `static/theme.js` and `static/theme.css`. The `"reactToolbox"` configuration includes styling, and the list of react-toolbox components to include.
22+
23+
## The idea behind the example
24+
25+
This is a simple example of getting react-toolbox up and running, using [react-toolbox-themr](https://github.com/react-toolbox/react-toolbox-themr).
26+
27+
For actual use, you probably also want to add Roboto Font, and Material Design Icons. See <http://react-toolbox.com/#/install>
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "with-react-toolbox",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start",
8+
"toolbox": "react-toolbox-themr"
9+
},
10+
"dependencies": {
11+
"classnames": "^2.2.5",
12+
"next": "latest",
13+
"react": "^15.5.4",
14+
"react-addons-css-transition-group": "^15.5.2",
15+
"react-dom": "^15.5.4",
16+
"react-toolbox": "^2.0.0-beta.8"
17+
},
18+
"devDependencies": {
19+
"react-toolbox-themr": "^1.0.2"
20+
},
21+
"reactToolbox": {
22+
"include": [
23+
"BUTTON",
24+
"DATE_PICKER"
25+
],
26+
"customProperties": {
27+
"animation-duration": "0.3s",
28+
"color-accent": "var(--palette-pink-a200)",
29+
"color-accent-dark": "var(--palette-pink-700)",
30+
"color-primary-contrast": "var(--color-dark-contrast)",
31+
"color-accent-contrast": "var(--color-dark-contrast)"
32+
},
33+
"output": "static"
34+
}
35+
}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import ThemeProvider from 'react-toolbox/lib/ThemeProvider'
2+
import theme from '../static/theme'
3+
import Head from 'next/head'
4+
5+
import Button from 'react-toolbox/lib/button/Button'
6+
7+
export default () => (
8+
<div>
9+
<Head>
10+
<link href='/static/theme.css' rel='stylesheet' />
11+
</Head>
12+
<ThemeProvider theme={theme}>
13+
<Button raised primary>Hello</Button>
14+
</ThemeProvider>
15+
</div>
16+
)

examples/with-react-toolbox/static/theme.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/with-react-toolbox/static/theme.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)