Skip to main content

Slider

shadow

Element Slider is an interactive slider component that allows users to select a value from a range of values in a convenient way. It features a handle that can be moved, making it ideal for those scenarios that require the user to provide numeric input or adjust some setting such as volume.

Basic usage

By default, the selection allows the user to select only one option. Including the Icon element will also display the selected icon next to the option.

Bubble

Adding the bubble attribute will display a bubble above the slider with a number representing the current value of the slider.

Label

;

Icons

Color

When to use

Use wje-slider when users need to enter values, choose options, or trigger form-related actions.

When not to use

Do not use it as a decorative element without interaction. Prefer presentational components in that case.

Accessibility

Always provide a label (label/aria-label), keep keyboard support, and surface clear validation feedback.

Best Practices

  • Keep validation rules and error behavior consistent across the entire form.
  • Show loading or disabled states during async operations.
  • Split complex forms into smaller sections with immediate feedback.

Attributes and Properties

max

DescriptionReturns the maximum value of the slider.
Attributemax
Typenumber
Default-

min

DescriptionReturns the minimum value of the slider.
Attributemin
Typenumber
Default-

step

DescriptionReturns the step value of the slider.
Attributestep
Typenumber
Default-

value

DescriptionReturns the value of the slider.
Attributevalue
Typenumber
Default-

disabled

DescriptionDisables user interaction with the component.
Attributedisabled
Typeany
Default-

bubble

DescriptionControls whether the slider value bubble is shown.
Attributebubble
Typeany
Default-

Events

NameDescription
wje-slider:initEmitted when the wje-slider:init event is dispatched.
wje-slider:moveEmitted when the wje-slider:move event is dispatched.
wje-slider:changeEmitted when the component value changes.

Methods

getPercentage

DescriptionCalculates the percentage of a value within a given range.
Signature(min: number, max: number, value?: number) => number

CSS Shadow Parts

No CSS shadow parts available for this component.

CSS Custom Properties

No CSS custom properties available for this component.

Slots

No slots available for this component.