You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+16-48
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@
19
19
Great UX starts with two basic principles - ease of use and simplicity. Selecting a color should be as easy as moving a slider, clicking a checkbox or pressing a key just like other basic form elements behave.
20
20
21
21
This is a flexible and minimalistic color picker. Developed with mobile devices and keyboard usage in mind. Key features:
22
-
* Small size - 3.6 KB gzipped (JS and CSS combined)
22
+
* Small size - 2.9 KB gzipped (JS and CSS combined)
23
23
* Supports touch devices
24
24
* Optimized animations
25
25
* Ease of use
@@ -38,18 +38,6 @@ The right color picker, but not the framework you're looking for?
38
38
*[AngularJs][link-angularjs-color-picker]
39
39
*[Angular][link-angular-color-picker]
40
40
41
-
## Quick Links
42
-
43
-
*[Demos](#demos)
44
-
*[Usage](#usage)
45
-
*[Options](#options)
46
-
*[FAQ](#first-asked-questions)
47
-
*[Change log](#change-log)
48
-
*[Migration](#migration)
49
-
*[Contributing](#contributing)
50
-
*[Credits](#credits)
51
-
*[License](#license)
52
-
53
41
## Demos
54
42
55
43
* Basic Example - [Codepen](https://codepen.io/rkunev/pen/mjKoyK/)
@@ -71,39 +59,32 @@ import ColorPicker from '@radial-color-picker/react-color-picker';
Depending on your build tool of choice (webpack, parcel, rollup) you may have to setup the appropriate loaders or plugins. If you're using `create-react-app` you don't have to do anything else - it comes preconfigured and supports CSS import out of the box.
95
-
96
-
[Back To Top](#quick-links)
77
+
Depending on your build tool of choice (vite, webpack, etc.) you may have to setup the appropriate plugins or loaders. If you're using `vite` you don't have to do anything else - it comes preconfigured and supports CSS import out of the box.
97
78
98
79
## Options
99
80
100
81
`ColorPicker` can be used either as a controlled component or as uncontrolled component.
101
82
```jsx
102
83
// Controlled component. Its current state is defined and updated by the props you pass to it.
@@ -122,8 +103,6 @@ Depending on your build tool of choice (webpack, parcel, rollup) you may have to
122
103
| onChange | Function | noop | Called every time the color changes, but unlike onInput this is not called while rotating the knob. |
123
104
| onSelect | Function | noop | Called when the user dismisses the color picker (i.e. interacting with the middle color well). |
124
105
125
-
[Back To Top](#quick-links)
126
-
127
106
## First Asked Questions
128
107
129
108
<details>
@@ -146,24 +125,21 @@ Depending on your build tool of choice (webpack, parcel, rollup) you may have to
146
125
<p>It's another non-passive event that could potentially introduce jank on scroll. To rotate the color knob, but stay on the same scrolling position the <code>wheel</code> event is blocked with <code>preventDefault()</code>. Thus, if you really want this feature for your users you'll have to explicitly add <code>mouseScroll={true}</code>.</p>
147
126
</details>
148
127
149
-
<details>
150
-
<summary>Why does Google Chrome throw a <code>[Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event.</code> warning in the console?</summary>
151
-
<p><code>touchmove</code> is used with <code>preventDefault()</code> to block scrolling on mobile while rotating the color knob. Even the <a href="https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#removing-the-need-to-cancel-events">Web Incubator Community Group</a> acknowledges that in some cases a passive event listener can't be used.</p>
152
-
</details>
153
-
154
128
<br>
155
129
156
-
[Back To Top](#quick-links)
157
-
158
130
## Change log
159
131
160
132
Please see [Releases][link-releases] for more information on what has changed recently.
161
133
162
-
[Back To Top](#quick-links)
163
-
164
134
## Migration
165
135
166
-
### Migration from v2
136
+
### Migration from v3 to v4
137
+
138
+
1. In an effort of project modernization, CJS build is no longer provided. The UMD build is deprecated and will be removed in a future version.
139
+
2. Non-minified builds are no longer provided. Use the minified build artifacts instead.
140
+
3. The StyleSheet in the `dist` directory has been renamed from `react-color-picker.min.css` to `style.css`.
141
+
142
+
### Migration from v2 to v3
167
143
168
144
1. Double-click to move the knob to the current position of the pointer is gone since this is now the default behavior as soon as the clicks on the palette. If you had a tooltip or a help section in your app that described the shortcut you should remove it.
169
145
@@ -186,7 +162,7 @@ Please see [Releases][link-releases] for more information on what has changed re
186
162
/>
187
163
```
188
164
189
-
### Migration from v1
165
+
### Migration from v1 to v2
190
166
191
167
v2 comes with lots of performance improvements like native CSS `conic-gradient` support and lots of bugfixes, but some things were changed as well.
192
168
@@ -232,25 +208,19 @@ v2 comes with lots of performance improvements like native CSS `conic-gradient`
If you're interested in the project you can help out with feature requests, bugfixes, documentation improvements or any other helpful contributions. You can use the issue list of this repo for bug reports and feature requests and as well as for questions and support.
240
214
241
215
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.
242
216
243
-
[Back To Top](#quick-links)
244
-
245
217
## Credits
246
218
247
219
-[Rosen Kanev][link-author]
248
220
-[All Contributors][link-contributors]
249
221
250
222
This component is based on the great work that was done for the AngularJs color picker [angular-radial-color-picker][link-angularjs-color-picker].
251
223
252
-
[Back To Top](#quick-links)
253
-
254
224
## License
255
225
256
226
The MIT License (MIT). Please see [License File](LICENSE) for more information.
@@ -261,6 +231,4 @@ The MIT License (MIT). Please see [License File](LICENSE) for more information.
0 commit comments