Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
casesandberg committed Mar 7, 2016
1 parent aa3e4ba commit e6c1d1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 38 deletions.
41 changes: 4 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

* **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

![Sketch and Photoshop Color Picker Built in React](http://casesandberg.github.io/react-color/screenshot.png)
Expand All @@ -17,47 +15,16 @@ npm install react-color --save
### Include the Component

```js
var React = require('react');
var ColorPicker = require('react-color');
import React from 'react';
import { SketchPicker } from '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.

```js
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>
);
return <SketchPicker type="sketch" />;
}
}
```
You can import `ChromePicker` `CompactPicker` `MaterialPicker` `PhotoshopPicker` `SketchPicker` `SliderPicker` `SwatchesPicker` respectively.

> 100% inline styles via [ReactCSS](http://reactcss.com/)
2 changes: 1 addition & 1 deletion docs/documentation/02.02-include.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class Component extends React.Component {
}
}
```
You can import `ChromePicker` `CompactPicker` `MaterialPicker` `PhotoshopPicker` `SketchPicker` `SliderPicker` `SwatchesPicker`
You can import `ChromePicker` `CompactPicker` `MaterialPicker` `PhotoshopPicker` `SketchPicker` `SliderPicker` `SwatchesPicker` respectively.

0 comments on commit e6c1d1c

Please sign in to comment.