UNPKG

1.97 kBMarkdownView Raw
1# react-simple-toolbar
2
3> A carefully crafted toolbar for React
4
5No support for overflowing items
6
7## Install
8
9```sh
10$ npm install react-simple-toolbar --save
11```
12
13## Usage
14
15```jsx
16var Toolbar = require('react-simple-toolbar')
17var Region = Toolbar.Region
18
19<Toolbar>
20 <Region>
21 Export
22 </Region>
23
24 <Region flex={2}>
25 <Toolbar>
26 <Region align="center">Import from CSV</Region>
27 <Region align="center">Import from Excel</Region>
28 </Toolbar>
29 </Region>
30
31 <Region>
32 Save
33 </Region>
34</Toolbar>
35
36//second example
37<Toolbar>
38 <Region align="left">
39 Export
40 </Region>
41
42 <Region align="right">
43 Save
44 </Region>
45</Toolbar>
46```
47
48## Props (for Toolbar.Region)
49
50 * align: String - either 'left', 'right' or 'center'
51
52 If you don't specify an align, here is how it will behave:
53 * if you only have 1 region in the toolbar, it will align 'left'
54 * if you have 2 regions in the toolbar, the first will align 'left', the second will align 'right'
55 * if you have 3 regions, they will align 'left', 'center' and 'right'
56
57 If you have no region in the toolbar, one will be created by default and will contain all toolbar children.
58
59 * flex: Number/String
60
61 ## Changelog
62
63 See [changelog](./CHANGELOG.md)
64
65 ## Contributing
66
67 Use [Github issues](https://github.com/zippyui/react-simple-toolbar/issues) for feature requests and bug reports.
68
69 We actively welcome pull requests.
70
71 For setting up the project locally, use:
72
73 ```sh
74 $ git clone https://github.com/zippyui/react-simple-toolbar
75 $ cd react-simple-toolbar
76 $ npm install
77 $ npm serve # to start http server
78 $ npm dev * to start webpack-dev-server
79 ```
80
81 Now navigate to [localhost:9091](http://localhost:9091/)
82
83 Before building a new version, make sure you run
84
85 ```sh
86 $ npm run build
87 ```
88 which compiles the `src` folder (which contains jsx files) into the `lib` folder (only valid EcmaScript 5 files).
89
90 ## License
91
92 #### MIT
\No newline at end of file