Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-radial-slider-v2

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-radial-slider-v2

React Native component to select or highlight a specific value from a range of values

  • 0.0.19
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Radial Slider - Simform

react-native-radial-slider

npm version Android iOS MIT


This is a pure javascript and react-native-svg based library that provides many variants of Radial Slider and Speedo Meter including default, radial-circle-slider, speedometer and speedometer-marker

Radial Slider allows you to select any specific value from a range of values. It comes with two variants, one is default and which allows selection on a 180-degree arc and the second one is 360-degree which allows selection of values on a complete circle. It can be used to select/set goals, vision, range, etc.

The Speedo Meter allows you to highlight a specific value from a range of values. It comes with two variants, the default one shows a needle and another one shows marking values with a needle. It can be used to display the speed of the internet, vehicle, fan, etc.

This library is easy to use and provides you full customization, so you can customize components based on your need.

🎬 Preview


RadialSliderSpeedoMeter
alt RadialSlideralt SpeedoMeter

Quick Access

Installation | RadialSlider | SpeedoMeter | Properties | Example | License

Installation

1. Install library and react-native-svg
$ npm install react-native-radial-slider react-native-svg
# --- or ---
$ yarn add react-native-radial-slider react-native-svg
2. Install cocoapods in the ios project
cd ios && pod install
Know more about react-native-svg

RadialSlider

  • RadialSlider has two different variants, default one and radial-circle-slider
  • RadialSlider can be used to select / set goal, vision, range etc

Default RadialSlider

🎬 Preview

Default RadialSlider

Usage

import React, { useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { RadialSlider } from 'react-native-radial-slider';

const RadialVariant = () => {
  const [speed, setSpeed] = useState(0);

  return (
    <View style={styles.container}>
      <RadialSlider value={speed} min={0} max={200} onChange={setSpeed} />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
  },
});

export default RadialVariant;

Radial Circle Silder

🎬 Preview

Default RadialCircleSlider

Usage

import React, { useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { RadialSlider } from 'react-native-radial-slider';

const RadialVariant = () => {
  const [speed, setSpeed] = useState(0);

  return (
    <View style={styles.container}>
      <RadialSlider
        variant={'radial-circle-slider'}
        value={speed}
        min={0}
        max={200}
        onChange={setSpeed}
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
  },
});

export default RadialVariant;

SpeedoMeter

The speedometer will not take user inputs, when we need to update dynamic values at that time we can use it

  • SpeedoMeter has two different variants, speedometer and speedometer-marker
  • SpeedoMeter can be used to display the speed of an internet, vehicle, fan etc

SpeedoMeter

🎬 Preview

Default SpeedoMeter

Usage

import React, { useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { RadialSlider } from 'react-native-radial-slider';

const SpeedoMeterVariant = () => {
  const [speed, setSpeed] = useState(0);

  return (
    <View style={styles.container}>
      <RadialSlider
        variant={'speedometer'}
        value={speed}
        min={0}
        max={200}
        onChange={setSpeed}
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
  },
});

export default SpeedoMeterVariant;

SpeedoMeter Marker

🎬 Preview

Default SpeedoMeterMarker

Usage

import React, { useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { RadialSlider } from 'react-native-radial-slider';

const SpeedoMeterVariant = () => {
  const [speed, setSpeed] = useState(0);

  return (
    <View style={styles.container}>
      <RadialSlider
        variant={'speedometer-marker'}
        value={speed}
        min={0}
        max={200}
        onChange={setSpeed}
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
  },
});

export default SpeedoMeterVariant;

Properties

PropDefaultTypeDescriptionRadialSliderSpeedoMeter
min*0numberMinimum value
max*100numberMaximum value
value*0numbeShow selection upto this value
onChange*-functionCallback function which fired on change in track
radius100numberSize of component
step1numberStep value for component
markerValue-numberShow marker on specific number
title-stringTitle for component
subTitleGoalstringSubtitle for component
unitRadilaSlider: 'kCal', SpeedoMeter: 'MB/S'stringUnit for component
thumbRadius18numberRadius for thumb
thumbColor#008ABCstringColor for thumb
thumbBorderWidth5numberWidth for thumb
thumbBorderColor#FFFFFFstringBorder Color for thumb
markerLineSize50numberSize of marker line
sliderWidth18numberWidth of slider
sliderTrackColor#E5E5E5stringColor of unselected slider track
lineColor#E5E5E5stringColor of unselected lines
lineSpace3numberSpace between each line
linearGradient[ { offset: '0%', color:'#ffaca6' }, { offset: '100%', color: '#EA4800' }]objectGradient color of selected track
onComplete-functionCallback function which defines what to do after completion
centerContentStyle{}objectCenter content style
titleStyle{}objectStatus title container style
subTitleStyle{}objectStatus subtitle text style
valueStyle{}objectCenter value style
buttonContainerStyle{}objectButton container style
leftIconStyle{}objectLeft Icon style
rightIconStyle{}objectRight Icon style
contentStyle{}objectWhole content style
unitStyle{}objectUnit text style
style{}objectInner container style
openingRadianRadialSlider: Math.PI / 3 , SpeedoMeter:0.057numberRadian of component
disabledfalsebooleanIf true, buttons will be in disabled state
isHideSliderfalsebooleanIf true, slider will be hidden
isHideCenterContentfalsebooleanIf true, center content will be hidden
isHideTitlefalsebooleanIf true, title will be hidden
isHideSubtitlefalsebooleanIf true, subtitle will be hidden
isHideValuefalsebooleanIf true, value will be hidden
isHideTailTextfalsebooleanIf true, tail text will be hidden
isHideButtonsfalsebooleanIf true, buttons will be hidden
isHideLinesfalsebooleanIf true,slider lines will be hidden
isHideMarkerLinefalsebooleanIf true, marked lines will be hidden
fixedMarkerfalsebooleanIf true, marked value will be hidden
variantdefaultstringDifferent component variants radial-circle-slider, speedometer, speedometer-marker
onPress{}functionBased on click value will be increased or decreased
stroke'#008ABC'stringColor for button icon
unitValueContentStyle{}objectUnit value content style
markerCircleSize15numberSize for marker circle
markerCircleColor#E5E5E5stringColor for marker circle
markerPositionY20numberMarker position for up and down
markerPositionX20numberMarker position for right and left
needleBackgroundColor#A020F0stringBackground color for needle
needleColor#175BADstringColor for needle
needleBorderWidth1.5numberWidth of needle border
needleHeight30numberHeight of needle
markerValueInterval10numberShow number of value in sequence
markerValueColor#333333stringColor for marker value
strokeLinecapbuttstringLine terminations, can be butt, line, or square

Example

A full working example project is here Example

$ yarn
$ yarn example ios   // For ios
$ yarn example android   // For Android

Find this library useful? ❤️

Support it by joining stargazers for this repository.⭐

🤝 How to Contribute

We'd love to have you improve this library or fix a problem 💪 Check out our Contributing Guide for ideas on contributing.

Bugs / Feature requests / Feedbacks

For bugs, feature requests, and discussion please use GitHub Issues

License

Keywords

FAQs

Package last updated on 03 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc