Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hezhii/rn-circular-slider

React Native circular slider based on react-native-svg
https://github.com/hezhii/rn-circular-slider

circle circular react-native slider svg

Last synced: about 5 hours ago
JSON representation

React Native circular slider based on react-native-svg

Awesome Lists containing this project

README

        

# rn-circular-slider

React Native circular slider based on [react-native-svg](https://github.com/react-native-community/react-native-svg)

## Installation

Install the `rn-circular-slider` package in your React Native project.

```bash
$ yarn add rn-circular-slider
```

Next, install [react-native-svg](https://github.com/react-native-community/react-native-svg)

```bash
$ yarn add react-native-svg
$ react-native link react-native-svg
```

## Usage

```js
import React, { Component } from 'react';
import { StyleSheet, View, Text } from 'react-native';

import CircularSlider from 'rn-circular-slider'

console.disableYellowBox = true

export default class App extends Component {
state = {
value: 50
}

render() {
const { value } = this.state
return (

this.setState({ value })}
contentContainerStyle={styles.contentContainerStyle}
strokeWidth={10}
buttonBorderColor="#3FE3EB"
buttonFillColor="#fff"
buttonStrokeWidth={10}
openingRadian={Math.PI / 4}
buttonRadius={10}
linearGradient={[{ stop: '0%', color: '#3FE3EB' }, { stop: '100%', color: '#7E84ED' }]}
>
{value}


);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
contentContainerStyle: {
justifyContent: 'center',
alignItems: 'center'
},
value: {
fontWeight: '500',
fontSize: 32,
color: '#3FE3EB'
}
});
```