Slider
Overview
The slider component allows users to select a numeric value within a defined range by dragging a thumb along a track or using increment/decrement buttons.
The MedKitSlider component provides an intuitive way to capture numeric input within a constrained range. It combines a visual slider track with a draggable thumb, reference numbers for scale orientation, and a numeric input field with increment/decrement buttons for precise value entry. The component supports both horizontal and vertical orientations, making it flexible for different layout needs. It includes built-in validation, error handling, and accessibility features to ensure a robust user experience.
When to use
- Slider should be used for numeric inputs that have a minimum and maximum range
- A good use case is a numeric input that represents a scale
When not to use
- Do not use the slider for numeric inputs that are not constrained to a range.
Interactive demo
The demo below allows you to preview the component. You can play with its props, variations, configuration options and dive into its events and even see them trigger in the event log tab.
MedKit Slider
Worst I can imagine
Best I can image
0
25
50
75
100
Your health today is
out of 100
Props Help
For each property in a component you can see:
- value-typethat it supports
- The default value
- If the prop is required
Orientation
'horizontal'
'vertical'
horizontal
Label
string
Min Label
string
Max Label
string
Min
number
0
Max
number
100
Required
Show Reference Numbers
boolean
true
Summary Label
string
Required
Required
boolean
false
Error
string
Array<string>
Error Hidden
boolean
false
Help Text
string
Placeholder
string
Horizontal Slider
Worst I can imagine
Best I can image
0
25
50
75
100
Your health today is
out of 100
Vertical Slider
Best I can image
100
75
50
25
0
Worst I can imagine
Your health today is
out of 100
Error
Worst I can imagine
Best I can image
0
25
50
75
100
Your health today is
This number is too large
out of 100
Min and Max
Worst I can imagine
Best I can image
-50
-25
0
25
50
Your mood score today is