1.0.0 • Published 9 months ago

@remirage/react-native-wheel-input v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Radial Slider

react-native-radial-input-slider

npm version downloads install size


About

react-native-radial-input-slider is a React Native component that provides a radial slider with an integrated input field for direct value entry. It allows users to select a specific value using a circular slider while also offering a text input for precise adjustments.

Features:

Radial Slider: Smooth, circular value selection. ✅ Direct Input: Users can enter values manually. ✅ Customizable: Modify colors, sizes, and behaviors. ✅ Dynamic Updates: Syncs values instantly. ✅ Ideal for Transactions: Perfect for selecting amounts, budgets, or other numerical inputs.


🎬 Preview

Radial Input Slider
Radial Input Slider

Installation

npm install react-native-radial-input-slider react-native-svg
# or
yarn add react-native-radial-input-slider react-native-svg

For iOS, run:

cd ios && pod install

Usage

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

const Example = () => {
  const [value, setValue] = useState(50);

  return (
    <View style={styles.container}>
      <RadialInputSlider value={value} min={0} max={100} onChange={setValue} />
    </View>
  );
};

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

export default Example;

Properties

PropDefaultTypeDescriptionRadialSliderSpeedoMeter
min*0numberMinimum value
max*100numberMaximum value
value*0numberShow selection upto this value
onChange*-functionCallback function that invokes on change in track
radius100numberSize of component
startAngle270number 1-360The angle at which the circular slider should start from.
step1numberStep value for component
markerValue-numberShow marker on specific number
title-stringTitle for component
subTitleGoalstringSubtitle for component
unitRadialSlider: '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

License

This project is licensed under the MIT License.

Credits

This package was inspired by react-native-radial-slider by Simform. The original package provided the base implementation for radial sliders, which was adapted and enhanced for this library.