Skip to main content
Version: Next

Slider

A slider input for selecting a value or range from a continuous or stepped interval. Supports single value, range, vertical orientation, marks, and tooltip display.

Live Example

Loading component...

Try It

Edit the code below to experiment with the component:

Live Editor
function Demo() {
  return (
    <div style={{ width: 400, padding: '20px 0' }}>
      <Slider
        min={0}
        max={100}
        defaultValue={70}
        step={1}
      />
    </div>
  );
}
Result
Loading...

Range Slider

Live Editor
function RangeSliderDemo() {
  return (
    <div style={{ width: 400, padding: '20px 0' }}>
      <h4>Basic Range</h4>
      <Slider range defaultValue={[20, 70]} min={0} max={100} />
      <br />
      <h4>Draggable Track</h4>
      <Slider range={{ draggableTrack: true }} defaultValue={[30, 60]} min={0} max={100} />
    </div>
  );
}
Result
Loading...

With Marks

Live Editor
function MarksDemo() {
  return (
    <div style={{ width: 400, padding: '20px 0' }}>
      <Slider
        min={0}
        max={100}
        defaultValue={37}
        marks={{
          0: '0°C',
          25: '25°C',
          50: '50°C',
          75: '75°C',
          100: '100°C',
        }}
      />
    </div>
  );
}
Result
Loading...

Stepped and Dots

Live Editor
function SteppedDemo() {
  return (
    <div style={{ width: 400, padding: '20px 0' }}>
      <h4>Step = 10 with Dots</h4>
      <Slider min={0} max={100} defaultValue={30} step={10} dots />
      <br />
      <h4>Step = 25</h4>
      <Slider min={0} max={100} defaultValue={50} step={25} dots
        marks={{ 0: '0', 25: '25', 50: '50', 75: '75', 100: '100' }} />
    </div>
  );
}
Result
Loading...

Vertical Slider

Live Editor
function VerticalDemo() {
  return (
    <div style={{ height: 300, display: 'flex', gap: 40, padding: '0 40px' }}>
      <Slider vertical defaultValue={30} />
      <Slider vertical range defaultValue={[20, 60]} />
      <Slider vertical defaultValue={50} dots step={10}
        marks={{ 0: '0', 50: '50', 100: '100' }} />
    </div>
  );
}
Result
Loading...

Props

PropTypeDefaultDescription
minnumber0Minimum value of the slider.
maxnumber100Maximum value of the slider.
defaultValuenumber70Initial value of the slider.
stepnumber1Step increment between values. Use null for marks-only mode.
disabledbooleanfalseWhether the slider is disabled.
reversebooleanfalseWhether to reverse the slider direction.
verticalbooleanfalseWhether to display the slider vertically.
keyboardbooleantrueWhether keyboard arrow keys can control the slider.
dotsbooleanfalseWhether to show dots at each step mark.
includedbooleantrueWhether to highlight the filled portion of the track.

Import

import Slider from '@superset/components';

Improve this page

This documentation is auto-generated from the component's Storybook story. Help improve it by editing the story file.