Skip to content

limel-slider: no way to unset / clear the value #4161

Description

@Kiarokh

New feature motivation

Every other input component in Lime Elements can be empty (unset): limel-input-field, limel-select, limel-checkbox, and so on all let the user represent "no value chosen yet", and most of them let the user clear a value they have entered.

limel-slider is the exception. It is built on a native <input type="range">, which always resolves to a value. As a result:

  • There is no way for a user to unset or cancel their choice.
    Once the thumb is anywhere on the track, there is no affordance to clear it or return to a "nothing selected" state. This is terrible for "un-required" questions in a form or a survey for example.
  • "Unset" is indistinguishable from the minimum.
    The component falls back to valuemin when no value is provided, so an untouched slider looks exactly like one a user deliberately dragged to its minimum. There is no way to tell the two apart, visually or programmatically.
  • It is inconsistent with the rest of the library.
    In a form that mixes a slider with other fields, everything else can be empty but the slider cannot.
  • required / invalid are effectively meaningless on a slider.
    Since the slider can never be empty, an "empty but required" state cannot be represented, so required-validation on a slider has nothing to validate against.
  • Accessibility gap.
Screen.Recording.2026-07-07.at.17.19.16.mov

Because the value can only ever be a number, assistive technology always announces a concrete value, even when the user has made no choice — there is no "not set" state to announce.

This matters for real use-cases such as an optional Priority, Probability, or Score field, where "no value yet" is a legitimate and meaningful state the user must be able to reach — both initially and by clearing a previous choice.

New feature description

  • limel-slider should support an unset state that is visually distinct from the minimum (e.g. no active fill, a neutral thumb position, and a placeholder instead of a number in the value indicator).
  • Users should be able to clear the value through a dedicated affordance (e.g. a clear button, and/or the keyboard).
  • The unset state should be conveyed to assistive technology (e.g. via aria-valuetext), and the clear affordance should have an accessible, context-aware label.
  • A slider should be able to be initialized unset, and consumers should be able to return it to the unset state programmatically.
Screen.Recording.2026-07-07.at.17.20.35.mov

New feature implementation

The component already treats "not a finite number" as its fallback path, so an unset state can build on that: track an internal "empty" flag separate from the value, suppress the fill and center the thumb when empty, show a placeholder (?) in the indicator, and add a clear affordance.

The main open design question is how to signal "cleared" back to consumers without a breaking change to the change event's current number payload (e.g. emitting NaN versus widening the payload to number | null). This trade-off is worth discussing on the accompanying PR.

Metadata

Metadata

Labels

bugSomething isn't workingfeatureNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions