npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rn-nui/slider

v0.1.2

Published

Native sliders for React Native

Readme

@rn-nui/slider

Native sliders for React Native with enhanced functionality and customization options. This component provides Material 3 sliders with comprehensive styling and behavior controls.

Installation

npm install @rn-nui/slider

or

yarn add @rn-nui/slider

iOS Setup

Not yet supported.

Android Setup

You'll need to override the theme of your app under /android/app/src/main/res/values/styles.xml to inherit from Material3Expressive.

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.Material3Expressive.DayNight.NoActionBar">
      <!-- Customize your theme here -->
    </style>
</resources>

Expo Setup

There is no plugin for Expo yet. You'll need to manually edit the native files as described above.

Usage

import { Slider } from '@rn-nui/slider';

// Basic slider
<Slider
  value={sliderValue}
  onValueChange={setSliderValue}
  minValue={0}
  maxValue={100}
/>

// Customized slider with presets for size and styling
<Slider
  size="lg"
  value={sliderValue}
  onValueChange={setSliderValue}
  minValue={0}
  maxValue={100}
  stepSize={5}
  activeTrackColor="#52796f"
  inactiveTrackColor="#e9ecef"
  thumbColor="#52796f"
  labelBehavior="floating"
  tickVisibilityMode="auto-limit"
  trackIconActiveStart="check_circle"
/>

// Centered slider (e.g., for audio panning)
<Slider
  value={panValue}
  onValueChange={setPanValue}
  minValue={-50}
  maxValue={50}
  centered={true}
/>

API Reference

Properties

| Prop | Type | Default | Description | | ------------------------ | ----------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------- | | size | SliderSize | undefined | Preset sizes controlling track height, thumb height and border radius. All these can be individually set instead of using a preset | | minValue | number | undefined | Minimum value of the slider | | maxValue | number | undefined | Maximum value of the slider | | stepSize | number | undefined | Determines the snap points | | value | number | undefined | Controlled value | | height | number | undefined | Height of the track | | trackColor | ColorValue | undefined | Color of the entire track. Use activeTrackColor and inactiveTrackColor to control specific colors | | activeTrackColor | ColorValue | undefined | Color of the track to left of the thumb | | inactiveTrackColor | ColorValue | undefined | Color of the track to right of the thumb | | trackCornerSize | number | undefined | Border radius of the track | | trackInsideCornerSize | number | undefined | Border radius between track and thumb | | trackIconActiveStart | string | undefined | Icon displayed in active section at start of track | | trackIconActiveEnd | string | undefined | Icon displayed in active section next to thumb | | trackIconInactiveStart | string | undefined | Icon display in inactive section next to thumb | | trackIconInactiveEnd | string | undefined | Icon displayed in inactive section at end of track | | trackIconActiveColor | ColorValue | undefined | Color of icons in active section | | trackIconInactiveColor | ColorValue | undefined | Color of icons in inactive section | | trackIconSize | number | undefined | Size of icons | | trackStopIndicatorSize | number | undefined | Size of the stop circle at the end of track | | thumbColor | ColorValue | undefined | Color of the thumb | | thumbWidth | number | undefined | Width of the thumb | | thumbHeight | number | undefined | Height of the thumb | | thumbElevation | number | undefined | Elevation of the thumb | | thumbBorderColor | ColorValue | undefined | Border color of the thumb | | thumbBorderWidth | number | undefined | Border width of the thumb | | thumbTrackGapSize | number | undefined | Space between thumb and track on both sides of thumb | | labelBehavior | SliderLabelBehavior | undefined | Behavior of label displaying current value | | tickColor | ColorValue | undefined | Color of ticks, regardless of active or inactive. Use activeTickColor and inactiveTickColor to control specific colors. | | activeTickColor | ColorValue | undefined | Color of ticks in active section | | inactiveTickColor | ColorValue | undefined | Color of ticks in inactive section | | activeTickRadius | number | undefined | Border radius of ticks in active section | | inactiveTickRadius | number | undefined | Border radius of ticks in inactive section | | tickVisibilityMode | SliderTickVisibility | undefined | Determines how the ticks are visible | | disabled | boolean | undefined | If true, the user won't be able to interact with the slider | | centered | boolean | undefined | Controls if the active section is tied to the center of track | | onChange | (event: SliderValueChangeEvent) => void | undefined | Callback called with the change event | | onValueChange | (value: number) => void | undefined | Callback called with just the new value | | onSlidingStart | (value: number) => void | undefined | Callback called when sliding starts | | onSlidingStop | (value: number) => void | undefined | Callback called when sliding stops |

Type Definitions

SliderSize
type SliderSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';

Preset sizes that control track height, thumb dimensions, and border radius.

SliderLabelBehavior
type SliderLabelBehavior = 'always-visible' | 'floating' | 'never-visible';
  • 'always-visible': The label is always visible
  • 'floating': The label floats above the thumb when sliding
  • 'never-visible': The label is never visible, even when sliding
SliderTickVisibility
type SliderTickVisibility = 'auto-limit' | 'auto-hide' | 'hidden';
  • 'auto-limit': Ticks are drawn. If there are too many, the maximum allowed number will be drawn
  • 'auto-hide': Ticks are drawn. If there are too many, they are all hidden
  • 'hidden': Ticks are always hidden (allows for snapping to points without showing ticks)
SliderValueChangeEvent
type SliderValueChangeEvent = NativeSyntheticEvent<{
  target: number;
  value: number;
}>;

Events

onChange

Called when the slider value changes. The event object contains target and value properties.

onValueChange

Called when the slider value changes with just the new numeric value.

onSlidingStart

Called when the user starts sliding with the current value.

onSlidingStop

Called when the user stops sliding with the final value.

Screenshots

| Centered | Icons | Preset sizes | Steps | | ---------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | | | | | |