@betterthings/scissors
v0.0.7
Published
handy image cropper with focus point editor
Downloads
1,393
Readme
Dependencies
You need to install react
and immutable
yourself.
Example
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}
/>
)
}
}