Skip to content
This repository was archived by the owner on Apr 10, 2021. It is now read-only.

lusbuab/scissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

67491d7 · Nov 6, 2018

History

19 Commits
Oct 8, 2018
Jun 11, 2018
Jun 8, 2018
Jun 8, 2018
Jun 8, 2018
Jun 8, 2018
Jun 8, 2018
Nov 6, 2018
Nov 6, 2018
Oct 12, 2018
Jun 11, 2018
Jun 11, 2018

Repository files navigation

Scissors by Better Things Digital

Dependencies

You need to install react and immutable yourself.

Demo

Here's a little demo of what the component can do: https://scissors.netlify.com/

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}
      />
    )
  }
}

Authors