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

@radix-ui/react-slider

Package Overview
Dependencies
Maintainers
6
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-slider

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
increased by1.2%
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 01 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