react-native-wheel-spinner
Wheel Spinner Component for React Native
Installation
Use the package manager npm and yarn to install react-native-wheel-spinner.
yarn add react-native-wheel-spinner
# or using npm
npm i react-native-wheel-spinner --save
Dependencies
This component is dependent on react-native-svg and D3-shape plugins.
Import
import Spinner from "react-native-wheel-spinner";
Usage
import React from 'react';
import { View } from 'react-native';
import Spinner from 'react-native-wheel-spinner';
const segments = [
{color:'blue',value:'Ram'},
{color:'red',value:'Shyam'},
{color:'orange',value:'Harish'},
{color:'olive',value:'Lucky'},
{color:'pink',value:'Kajal'},
];
const data = [
{name:'Ram',age:20},
{name:'Shyam',age:29},
{name:'Harish',age:24},
{name:'Lucky',age:25},
{name:'Kajal',age:30}
]
const App = ()=>{
return(
<View>
<Spinner
data={data}
segments={segments}
getWinner={(winner)=>{
console.log(winner)
}}
/>
</View>
)
}