🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@radix-ui/react-slider

Package Overview
Dependencies
Maintainers
6
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-slider

View docs [here](https://radix-ui.com/primitives/docs/components/slider).

1.3.5
latest
Source
npm
Version published
Weekly downloads
6M
18.96%
Maintainers
6
Weekly downloads
 
Created

What is @radix-ui/react-slider?

@radix-ui/react-slider is a React component library for creating accessible and customizable sliders. It provides a range of features to create sliders with various configurations and styles, ensuring they are accessible and easy to use.

What are @radix-ui/react-slider's main functionalities?

Basic Slider

This code demonstrates a basic slider with a default value of 50, a maximum value of 100, and a step increment of 1.

import { Slider } from '@radix-ui/react-slider';

function BasicSlider() {
  return (
    <Slider defaultValue={[50]} max={100} step={1} />
  );
}

Range Slider

This code demonstrates a range slider with default values of 20 and 80, a maximum value of 100, and a step increment of 1.

import { Slider } from '@radix-ui/react-slider';

function RangeSlider() {
  return (
    <Slider defaultValue={[20, 80]} max={100} step={1} />
  );
}

Vertical Slider

This code demonstrates a vertical slider with a default value of 50, a maximum value of 100, and a step increment of 1.

import { Slider } from '@radix-ui/react-slider';

function VerticalSlider() {
  return (
    <Slider orientation="vertical" defaultValue={[50]} max={100} step={1} />
  );
}

Custom Styled Slider

This code demonstrates a slider with custom styles applied via a CSS class. The custom styles can be defined in a separate CSS file.

import { Slider } from '@radix-ui/react-slider';
import './customSlider.css';

function CustomStyledSlider() {
  return (
    <Slider className="custom-slider" defaultValue={[50]} max={100} step={1} />
  );
}

Other packages similar to @radix-ui/react-slider

FAQs

Package last updated on 20 May 2025

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