Skip to content

Slidebar ​

Brief Introduction ​

The slidebar slider component is used for users to select a value within a range by dragging a slider.
You can use <MYSlidebar></MYSlidebar> or <MYSlidebar /> to implement a slider.

Basic Usage ​

Use v-model to bind the slider's value.

Code Demo
0
展开代码

Custom Thumb Color ​

Use the thumbColor property to customize the color of the slider thumb.

Code Demo
0
展开代码

Custom Track Color ​

Use the trackColor property to customize the color of the slider track.

Code Demo
0
展开代码

Disabled State ​

Use the disabled property to disable the slider.

Code Demo
0
展开代码

Hide Numeric Value ​

Use the noNum property to hide the slider's numeric value display.

Code Demo
展开代码

Custom Size ​

Use the size property to customize the size of the slider.

Code Demo
0
展开代码

Combined Usage ​

Finally, combine multiple APIs to create a customized slider:

Code Demo
展开代码

API Reference ​

Props ​

ParameterDescriptionTypeOptionsDefault
modelValueBound valuenumber—0
sizeSlider sizestringpx / rem / em / % / dynamic binding—
thumbColorThumb colorstringSupports hex colors or named colors—
trackColorTrack colorstringSupports hex colors or named colors—
disabledWhether disabledboolean—false
noNumWhether to hide numberboolean—false

Type Definition ​

typescript
interface SlidebarProps {
  modelValue?: number;
  size?: string;
  thumbColor?: string;
  trackColor?: string;
  disabled?: boolean;
  noNum?: boolean;
}

Released under the MIT License.