Sourceful Energy

Slider

An input where the user selects a value from within a given range.

Installation

import { Slider } from "@sourceful-energy/ui"

Usage

Examples

With Label and Value

50%

Custom Range

Charge Limit

80%

Limiting charge to 80% can extend battery life.

Disabled

Props

PropTypeDefaultDescription
valuenumber[]-The controlled value of the slider.
defaultValuenumber[][0]The default value when uncontrolled.
onValueChange(value: number[]) => void-Callback when the value changes.
minnumber0The minimum value.
maxnumber100The maximum value.
stepnumber1The stepping interval.
disabledbooleanfalseWhether the slider is disabled.

Accessibility

  • Built on Radix UI Slider for full accessibility
  • Keyboard navigation (Arrow keys to adjust)
  • ARIA attributes automatically managed
  • Visible focus indicator on thumb