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

react-native-slider-opensource

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-slider-opensource

a slider library for react native

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Custom Slider

A customizable React Native slider component with optional styling options.

Installation

Install the package using npm or yarn:

npm i react-native-slider-opensource

Usage

import React, { useState } from 'react';
import { View, Text } from 'react-native';
import CustomSlider from 'react-native-custom-slider';

const App = () => {
  const [sliderValue, setSliderValue] = useState(0);

  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text style={{ color: 'black' }}>{sliderValue}</Text>
      <CustomSlider
        width={200}
        textColor={'white'}
        sliderColor={'green'}
        backgroundColor={'black'}
        minValue={1} 
        maxValue={30}
        setSliderValue={setSliderValue} //required
        sliderValue={sliderValue}   //required
        displayText={'%'}
      />
    </View>
  );
};

export default App;

displayText: Text to display next to the minimum and maximum values.

Props

Required Props

  1. sliderValue: (required) Current value of the slider.
  2. setSliderValue: (required) Callback function to update the slider value.

Optional Props

  1. width (optional): Width of the slider (default is 200).
  2. textColor (optional): Color of the text (default is 'black').
  3. sliderColor (optional): Color of the slider (default is 'green').
  4. backgroundColor (optional): Background color of the slider (default is 'lightgray').
  5. minValue: Minimum value of the slider.
  6. maxValue: Maximum value of the slider.

License

This project is licensed under the MIT License - see the LICENSE file for details. Feel free to further customize the README according to your project's specifics.

Keywords

FAQs

Package last updated on 12 Feb 2024

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