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
Slider Marks Vertical
Slider
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.
Name | Type | Default | Description |
---|---|---|---|
name | string | Name of the input | |
label | string | null | Label of the input |
placeholder | string | null | Placeholder of the input |
disableShrink | boolean | false | Position the label outside of the input |
value | string or number | Value of the input | |
onChange | function | Callback function that is fired when the value changes. | |
inputClassName | string | null | Classname for input element |
labelClassName | string | null | Classname for label element |
errorClassName | string | null | Classname for error element |
disabled | boolean | false | Disable the input |
range | boolean | false | Range option for the input |
vertical | boolean | false | Vertical variant of the input |
error | string or boolean or object | null | Error message to display below the input. if value is a boolean input border will be change. Also you can pass schema validator error objects. |
min | number | null | Min value of the slider |
max | number | null | Max value of the slider |
step | number | null | Step count of the handle movement |
tracksClassName | string | null | Classname for slider tracks |
trackClassName | string | null | Classname for slider track |
railClassName | string | null | Classname for slider rail |
handleClassName | string | null | Classname for slider handle |