react-native-avatar-crop

Highly customisable Crop component for React Native.

react-native-avatar-crop

Usage

check dependencies

  let crop;
  const {width: SCREEN_WIDTH} = Dimensions.get('window');

  <Crop
    source={uri}
    cropShape={"circle"} // rect || circle
    width={SCREEN_WIDTH}
    height={SCREEN_WIDTH}
    cropArea={{
      width: SCREEN_WIDTH / 1.3,
      height: SCREEN_WIDTH / 1.3,
    }}
    borderWidth={0}
    backgroundColor={'#FFFFFF'}
    opacity={0.7} // 0 till 1, default is 0.7
    maxZoom= {3} // default 3
    resizeMode={"contain"} // default "cover"
    onCrop={cropCallback => (crop = cropCallback)} // returns a function
  />

see full example here

CONTRIBUTING

  1. Whether you are a novice or experienced software developer, all contributions and suggestions are welcome!

    Clone repo

    git clone https://github.com/vemarav/react-native-avatar-crop.git

  2. Add features or bug fixes

  3. Make a Pull Request

    OR

    Report a bug here

    Feel free to contribute, hosted on ❤️ with Github.

TODO

  • [ ] Add rotation support

GitHub

https://github.com/vemarav/react-native-avatar-crop