@pikas-ui/slider

This package contains a slider component that can be used to select a value from a range.

This library is based on Radix Ui.

Change Log

Requirements

To use this package, you must install the @pikas-ui/styles package.

Installation

You can install this package using npm, yarn, or pnpm.

npm install @pikas-ui/slider
yarn add @pikas-ui/slider
pnpm add @pikas-ui/slider

Usage

Slider

This component is used to select a value from a range. It can be used as a single slider or as a range slider.

Eu est labore ea laborum laborum mollit non minim eu commodo.

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

const Example: React.FC = () => {
  return (
    <Slider
      defaultValue={[25]}
      label="Slider label"
      description="Eu est labore ea laborum laborum mollit non minim eu commodo."
    />
  );
};

Props

PropDescriptionTypeDefault
defaultValueThe initial value of the slider.number[]-
onChangeCallback function that is called when the slider value changes.(value: number[]) => void-
idThe id of the slider.string-
labelThe label of the slider.string or ReactNode-
textErrorThe error text of the slider.string-
fontSizeThe font size of the slider.PikasFontSizeem-base
classNameThe class name of the slider.string-
descriptionThe description of the slider.string-
valueThe value of the slider.number[]-
disabledIf the slider is disabled.booleanfalse
minThe minimum value of the slider.number0
maxThe maximum value of the slider.number100
nameThe name of the slider.string-
directionThe direction of the slider.SliderDirectionltr
orientationThe orientation of the slider.SliderOrientationhorizontal
stepThe step of the slider.number1
minStepsBetweenThumbsThe minimum number of steps between thumbs.number1
sizeThe size of the slider.string or number100%
maxSizeThe max size of the slider.string or number100%
minSizeThe min size of the slider.string or number-
weightThe weight of the slider.number4
thumbSizeThe size of the thumb.number16
thumbColorNameThe color of the thumb.PikasColors"white"
thumbColorHexThe hex color of the thumb.string-
thumbBorderColorNameThe color of the thumb border.PikasColors-
thumbBorderColorHexThe color of the thumb border in hexadecimalstring-
thumbBorderColorNameHoverThe color of the thumb border on hover.PikasColors"gray-lighter"
thumbBorderColorHoverHexThe color of the thumb border on hover in hexadecimal.string-
thumbBorderWidthThe width of the thumb border.number-
thumbBorderRadiusThe radius of the thumb border.PikasRadius"full"
trackColorNameThe color of the track.PikasColors"gray-lighter"
trackColorHexThe color of the track in hexadecimal.string-
rangeColorNameThe color of the range.PikasColors-
rangeColorHexThe color of the range in hexadecimal.string-
sliderBorderRadiusThe radius of the slider border.PikasRadius"full"
cssThe css of the slider.SliderCSS-
invertedIf the slider is inverted.boolean-
onValueCommitCallback function that is called when the slider value changes.(value: number[]) => void-

Contributing

This documentation can be edited on GitHub here