TidalUI

Slider preview

Adjust a value with a pointer, touch or keyboard.

free · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add https://tidalui.com/r/slider.json

Import components/ui/tidal.css, components/ui/slider.css. Wrap installed components in tidal-scope.

Preview

Slider component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/slider.css";
import{TidalSlider}from"./components/ui/slider";
export default()=><div className="tidal-scope"><TidalSlider label={"Demo"} onValueChange={() => {}} value={[1]}/></div>;

API and props

TidalSliderDigits.text (required)
string

Required text value accepted by this exported component.

TidalSlider.label (required)
string

Required label value accepted by this exported component.

TidalSlider.onValueChange (required)
(value: TidalSliderValue) => void

Callback invoked when the value change interaction is proposed.

TidalSlider.value (required)
TidalSliderValue

Required value value accepted by this exported component.

TidalSlider.description
string | undefined

Optional description value accepted by this exported component.

TidalSlider.error
string | undefined

Optional error value accepted by this exported component.

TidalSlider.formatValue
((value: number) => string) | undefined

Optional format value value accepted by this exported component.

TidalSlider.marks
Array<{ value: number; label?: string; }> | undefined

Optional marks value accepted by this exported component.

TidalSlider.onValueCommit
((value: TidalSliderValue) => void) | undefined

Callback invoked when the value commit interaction is proposed.

TidalSlider.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalSlider.rootClassName
string | undefined

Optional root class name value accepted by this exported component.

TidalSlider.showValue
boolean | undefined

Optional show value value accepted by this exported component.

TidalSlider.thumbLabels
[string] | [string, string] | undefined

Optional thumb labels value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas