@@ -13,7 +13,7 @@ styles & features inspired by [React Select](http://jedwatson.github.io/react-se
13
13
14
14
[ ![ ] ( http://i.imgsafe.co/rQmogzn.gif )] ( http://furqanZafar.github.io/react-selectize/ )
15
15
16
- - [ Changelog] ( CHANGELOG.md ) (last updated on 2nd February 2016)
16
+ - [ Changelog] ( CHANGELOG.md ) (last updated on 7th February 2016)
17
17
- [ API Reference] ( API.md )
18
18
19
19
# Motivation
@@ -23,6 +23,7 @@ styles & features inspired by [React Select](http://jedwatson.github.io/react-se
23
23
24
24
## Features
25
25
* [ Drop in replacement for React.DOM.Select] ( http://furqanzafar.github.io/react-selectize/#/?category=simple&example=drop-in-replacement-for-react.dom.select )
26
+ * [ Customizable themes] ( http://furqanzafar.github.io/react-selectize/#/?category=simple&example=themes )
26
27
* Stateless, therefore extremely flexible & extensible
27
28
* Clean and compact API fully documented on GitHub
28
29
* [ Multiselect support] ( http://furqanzafar.github.io/react-selectize/#/?category=multi&example=multi-select )
@@ -40,37 +41,37 @@ styles & features inspired by [React Select](http://jedwatson.github.io/react-se
40
41
* [ Mark options as unselectable] ( http://furqanzafar.github.io/react-selectize/#/?category=simple&example=selectability )
41
42
* [ Disable selected values] ( http://furqanzafar.github.io/react-selectize/#/?category=multi&example=disable-selected )
42
43
* [ Absolute positioned overlay, "Tether"ed to the search field] ( http://furqanzafar.github.io/react-selectize/#/?category=multi&example=tether )
43
- * Customizable styles, comes with Stylus files
44
44
45
45
## Install
46
+
47
+ * ** npm:**
46
48
` npm install react-selectize `
47
49
48
- ## Usage (livescript)
49
- ```
50
- {create-factory}:React = require \react
51
- {SimpleSelect, MultiSelect, ReactSelectize} = require \react-selectize
52
- SimpleSelect = create-factory SimpleSelect
53
- MultiSelect = create-factory MultiSelect
54
- .
55
- .
56
- .
57
- SimpleSelect do
58
- placeholder: 'Select a fruit'
59
- options: <[apple mango orange banana]> |> map ~> label: it, value: it
60
- on-value-change: (value) ~>
61
- alert value
62
- .
63
- .
64
- .
65
- MultiSelect do
66
- placeholder: 'Select fruits'
67
- options: <[apple mango orange banana]> |> map ~> label: it, value: it
68
- on-values-change: (values) ~>
69
- alert values
50
+ to include the default styles add the following import statement to your stylus file:
51
+ ` @import 'node_modules/react-selectize/themes/index.css' `
52
+
53
+ * ** 1998 script tag:**
54
+ ``` html
55
+ <html >
56
+ <head >
57
+ <script src =" http://www.preludels.com/prelude-browser-min.js" type =" text/javascript" ></script >
58
+ <
script src =
" https://npmcdn.com/[email protected] /dist/index.min.js" type =
" text/javascript" ></
script >
59
+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-with-addons.min.js" type =" text/javascript" ></script >
60
+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.min.js" type =" text/javascript" ></script >
61
+
62
+ <!-- optional dependency (only required with using the tether prop) -->
63
+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/tether/1.1.1/js/tether.min.js" type =" text/javascript" ></script >
64
+
65
+ <
script src =
" https://npmcdn.com/[email protected] /dist/index.min.js" type =
" text/javascript" ></
script >
66
+
67
+ <!-- built in themes (default, bootstrap3, material) -->
68
+ <
link rel =
" stylesheet" href =
" https://npmcdn.com/[email protected] /dist/index.min.css" />
69
+ </head >
70
+ </html >
70
71
```
71
72
72
73
## Usage (jsx)
73
- ```
74
+ ``` javascript
74
75
React = require (" react" );
75
76
ReactSelectize = require (" react-selectize" );
76
77
SimpleSelect = ReactSelectize .SimpleSelect ;
@@ -104,11 +105,29 @@ MultiSelect = ReactSelectize.MultiSelect;
104
105
/ >
105
106
```
106
107
107
- ## Usage (stylus)
108
- to include the default styles add the following import statement to your stylus file:
109
-
110
- ` @import 'node_modules/react-selectize/src/index.css' `
111
-
108
+ ## Usage (livescript)
109
+ ``` LiveScript
110
+ {create-factory}:React = require \react
111
+ {SimpleSelect, MultiSelect, ReactSelectize} = require \react-selectize
112
+ SimpleSelect = create-factory SimpleSelect
113
+ MultiSelect = create-factory MultiSelect
114
+ .
115
+ .
116
+ .
117
+ SimpleSelect do
118
+ placeholder: 'Select a fruit'
119
+ options: <[apple mango orange banana]> |> map ~> label: it, value: it
120
+ on-value-change: (value) ~>
121
+ alert value
122
+ .
123
+ .
124
+ .
125
+ MultiSelect do
126
+ placeholder: 'Select fruits'
127
+ options: <[apple mango orange banana]> |> map ~> label: it, value: it
128
+ on-values-change: (values) ~>
129
+ alert values
130
+ ```
112
131
113
132
## Gotchas
114
133
* the default structure of an option object is ` {label: String, value :: a} ` where ` a ` implies that ` value ` property can be of any equatable type
0 commit comments