0.1.7 • Published 5 years ago

react-native-color-wheel v0.1.7

Weekly downloads
83
License
MIT
Repository
github
Last release
5 years ago

react-native-color-wheel

npm version

:art: A react native reusable and color picker wheel

Usage

import React, { Component } from 'react';
import { Dimensions, StyleSheet, View } from 'react-native';
import { ColorWheel } from 'react-native-color-wheel';

const Example = ({onChange}) => (
  <View style={{flex: 1}}>
    <ColorWheel
      initialColor="#ee0000"
      onColorChange={color => console.log({color})}
      onColorChangeComplete={color => onChange(color)}
      style={{width: Dimensions.get('window').width}}
      thumbStyle={{ height: 30, width: 30, borderRadius: 30}}
    />
    <ColorWheel
      initialColor="#00ee00"
      style={{ marginLeft: 20, padding: 40, height: 200, width: 200 }}
    />
  </View>
);

Props

NameDescriptionType
initialColorInitial value in hex formatString
onColorChangeCallback when the value is changed or movedfunc
onColorChangeCompleteCallback on mouseup or drag event has finishedfunc
thumbSizeWidth of draggable thumbNumber
thumbStyleCSS for the draggable thumbObject

PRs and issues are more than welcome.

 This package powers Yeti Smart Home and is used in production. Follow us in Github or https://twitter.com/netbeast_co.