@betterthings/scissors
Version:
handy image cropper with focus point editor
37 lines (27 loc) • 760 B
Markdown

## Dependencies
You need to install `react` and `immutable` yourself.
## Example
```js
import { Scissors, ScissorsState } from '@betterthings/scissors'
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
scissorsState: new ScissorsState({ imageUrl: '/path/to/img.jpg' }),
}
this.onScissorsChange = this.onScissorsChange.bind(this)
}
onScissorsChange(scissorsState) {
this.setState({ scissorsState })
}
render() {
return (
<Scissors
scissors={this.state.scissorsState}
onChange={this.onScissorsChange}
/>
)
}
}
```