SchwarzIT / onyx

🚀 A design system and Vue.js component library created by Schwarz IT
https://onyx.schwarz
Apache License 2.0
58 stars 5 forks source link

Implement OnyxSlider component #2111

Open JoCa96 opened 1 week ago

JoCa96 commented 1 week ago

Open Questions/To-dos

Depends on

Why?

As a user, I want to be able to select a value in a defined range of continuous numbers using a slider, so that the number selection happens with emphasis on its relation to the given minimum and maximum.

For the selection of a small range of discrete values, the OnyxStepper or OnyxSelect should be preferred.

Design

Acceptance criteria

Implementation details

export type OnyxSliderProps<TType extends "range" | "single"> = {
  modelValue?: TType extends "single" ? number : [ number, number ]; // Using a tuple for range slider
  range: TType extends "single" ? true : false;
  label: string;
}

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/slider_role

Reference implementations

Applicable ARIA Pattern

Definition of Done

Approval