Documentation
Form Components
Slider

Slider

A series of interactive headings arranged vertically, each revealing a section of content when clicked.

Installation

Install the package

npm i @start-base/react-form-elements

Add the styles

To use the React form elements styles in a Next.js project, import the styles in your layout.tsx file.

app/layout.tsx
import "@start-base/react-form-elements/styles.css";

Import the component

import Slider from '@start-base/react-form-elements/Slider';

Usages

Slider

Slider Disabled

Slider

Slider Marks

Slider
0°C26°C37°C50°C100°C

Slider Marks Vertical

Slider
0°C26°C37°C50°C100°C

Slider Range Component

Slider

Slider Vertical

Slider

Slider Error

Slider
Error Message

API

This component is a wrapper around rc-slider (opens in a new tab) component. All props from rc-slider API Reference (opens in a new tab) can be passed to this component.

NameTypeDefaultDescription
namestringName of the input
labelstringnullLabel of the input
placeholderstringnullPlaceholder of the input
disableShrinkbooleanfalsePosition the label outside of the input
valuestring or numberValue of the input
onChangefunctionCallback function that is fired when the value changes.
inputClassNamestringnullClassname for input element
labelClassNamestringnullClassname for label element
errorClassNamestringnullClassname for error element
disabledbooleanfalseDisable the input
rangebooleanfalseRange option for the input
verticalbooleanfalseVertical variant of the input
errorstring or boolean or objectnullError message to display below the input. if value is a boolean input border will be change. Also you can pass schema validator error objects.
minnumbernullMin value of the slider
maxnumbernullMax value of the slider
stepnumbernullStep count of the handle movement
tracksClassNamestringnullClassname for slider tracks
trackClassNamestringnullClassname for slider track
railClassNamestringnullClassname for slider rail
handleClassNamestringnullClassname for slider handle

Styling