Shopware Design

Slider

Usage

Slider lets users adjust a numeric value within a known range by dragging along a scale. Use it for settings such as limits, thresholds, percentages, or price ranges, where seeing the relative position of a value is more helpful than typing alone.

import { MtSlider } from "@shopware-ag/meteor-component-library";

Examples

Range

API reference

Props

PropTypeDefault
label *
Defines the label of the slider
string
required
Determines if the field is required.
false | truefalse
disabled
Determines if the field is disabled.
false | truefalse
namestringnull
help-text
A text that helps the user to understand what this field does.
string""
is-inherited
Toggles the inheritance visualization.
false | truefalse
is-inheritance-field
Determines if the field is inheritable.
false | truefalse
hint
Optional caption below the field. The `#hint` slot takes precedence when provided.
string | nullnull
model-value
The value of the slider. If isRange is true, this should be an array with two values. If isRange is false, this should be a single number.
number | number[]0
size
The size of the slider.
"default" | "small""default"
copyable-tooltip
If set to true the tooltip will change on successful copy.
false | truefalse
copyable
Toggles the copy function of the slider.
false | truefalse
disable-inheritance-toggle
Determines the active state of the inheritance toggle.
false | truefalse
has-focusfalse | truefalse
max
Defines the maximum value of the number.
number100
min
Defines the minimum value of the number.
number0
step
Defines the amount of which the number is increased or decreased per step.
number1
is-range
Defines if it is a range slider.
false | truefalse
min-distance
Defines the minimum distance between the two sliders. Should be a multiple of the step.
number0
mark-count
Defines the amount of marks on the slider.
number5
on-update:model-value((...args: any[]) => any) | undefined
on-inheritance-remove((...args: any[]) => any) | undefined
on-inheritance-restore((...args: any[]) => any) | undefined

Exposed

NameType
futureany
idstring
rangeRightValuenumber
rangeLeftValuenumber
activeSlider"left" | "right" | null
showFieldHintboolean
identificationstring
inheritanceState"none" | "linked" | "unlinked"
labelStyleCSSProperties
stringRepresentationstring
styleStartPositionstring
styleEndPositionstring
markStepnumber
toolTipTextstring
toolTipStyle{ display: string; left?: undefined; transform?: undefined; right?: undefined; } | { left: string; transform: string; display?: undefined; right?: undefined; } | { right: string; transform: string; display?: undefined; left?: undefined; }

Best practices

Do
  • Use a clear label that explains what the scale controls.
  • Set sensible min, max, and step values for the use case.
  • Use a range slider when users need to set both a lower and upper bound together.
Don't
  • Do not use Slider when precise text or number entry is the primary need.
  • Do not use a very large range with tiny steps if dragging would become frustrating.
  • Do not rely only on the visual bar to explain the meaning of the selected value.

Behavior

  • Slider can represent either a single numeric value or a two-value range through isRange.
  • The component includes linked number inputs, so users can adjust values by dragging or by typing.
  • markCount, step, and minDistance help shape how the scale behaves and how dense the value guidance feels.

Accessibility

  • Use a visible label that makes the meaning of the scale clear.
  • Make sure the chosen range and step size still allow keyboard users to reach useful values efficiently.
  • Avoid using Slider for critical settings if users need extremely precise control without an alternate input path.
  • Number Field: when precise numeric entry matters more than direct manipulation.