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

@react-native-community/slider

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-community/slider

React Native component used to select a single value from a range of values.

  • 4.5.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
347K
increased by6.92%
Maintainers
2
Weekly downloads
 
Created

What is @react-native-community/slider?

@react-native-community/slider is a React Native component for creating sliders, which are UI elements that allow users to select a value from a range by moving a thumb along a track. This package is useful for scenarios where you need to capture a range of values, such as volume control, brightness adjustment, or any other numeric input.

What are @react-native-community/slider's main functionalities?

Basic Slider

This code demonstrates a basic slider with a minimum value of 0 and a maximum value of 1. The slider has custom colors for the minimum and maximum track.

import Slider from '@react-native-community/slider';
import React from 'react';
import { View } from 'react-native';

const BasicSlider = () => {
  return (
    <View>
      <Slider
        style={{width: 200, height: 40}}
        minimumValue={0}
        maximumValue={1}
        minimumTrackTintColor="#FFFFFF"
        maximumTrackTintColor="#000000"
      />
    </View>
  );
};

export default BasicSlider;

Slider with Custom Thumb

This code demonstrates a slider with a custom thumb image. The thumbImage prop is used to set a custom image for the slider's thumb.

import Slider from '@react-native-community/slider';
import React from 'react';
import { View, Image } from 'react-native';

const CustomThumbSlider = () => {
  return (
    <View>
      <Slider
        style={{width: 200, height: 40}}
        minimumValue={0}
        maximumValue={100}
        thumbImage={require('./path/to/thumbImage.png')}
      />
    </View>
  );
};

export default CustomThumbSlider;

Slider with Step Value

This code demonstrates a slider with a step value of 1. The step prop ensures that the slider's thumb moves in increments of 1.

import Slider from '@react-native-community/slider';
import React from 'react';
import { View } from 'react-native';

const StepSlider = () => {
  return (
    <View>
      <Slider
        style={{width: 200, height: 40}}
        minimumValue={0}
        maximumValue={10}
        step={1}
      />
    </View>
  );
};

export default StepSlider;

Other packages similar to @react-native-community/slider

Keywords

FAQs

Package last updated on 25 Oct 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