forked from casesandberg/react-color
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request casesandberg#4 from casesandberg/gh-pages
1.0 ✨
- Loading branch information
Showing
101 changed files
with
50,356 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"preset": "airbnb", | ||
"disallowQuotedKeysInObjects": null, | ||
"validateQuoteMarks": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# [React Color](http://casesandberg.github.io/react-color/) | ||
|
||
* **7 Different Pickers** - Sketch, Photoshop, Chrome and many more | ||
|
||
* **Popup or Block** - It can be used it as a popup or always visible | ||
|
||
* **Make Your Own** - Use the building block components to make your own | ||
|
||
 | ||
|
||
## Installation & Usage | ||
|
||
``` | ||
npm install react-color --save | ||
``` | ||
|
||
### Include the Component | ||
|
||
``` | ||
var React = require('react'); | ||
var ColorPicker = require('react-color'); | ||
class Component extends React.Component { | ||
render() { | ||
return <ColorPicker type="sketch" />; | ||
} | ||
} | ||
``` | ||
|
||
### Display It | ||
Display the color picker popup on click, or don't define display and it will always be visible. | ||
|
||
``` | ||
var React = require('react'); | ||
var ColorPicker = require('react-color'); | ||
class Component extends React.Component { | ||
constructor() { | ||
super(); | ||
this.state = { | ||
displayColorPicker: false, | ||
}; | ||
this.handleClick = this.handleClick.bind(this); | ||
} | ||
handleClick() { | ||
this.setState({ displayColorPicker: !this.state.displayColorPicker }); | ||
} | ||
render() { | ||
return ( | ||
<div> | ||
<button onClick={ this.handleClick }>Pick Color</button> | ||
<ColorPicker display={ this.state.displayColorPicker } type="sketch" /> | ||
</div> | ||
); | ||
} | ||
} | ||
``` | ||
|
||
> 100% inline styles via [ReactCSS](http://reactcss.com/) |
Oops, something went wrong.