Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Android docs
FormsAndroid

Range slider

Choose bounded numeric intervals with independently adjustable native endpoints.

Public APILumenRangeSliderAndroid / Compose

Native example

Use Range slider

Bounds must be finite, increasing, and have a finite span. Nonfinite values fall back to bounds; reversed endpoints reorder for display without changing host state. Keep exact financial arithmetic in the application.

Range slider rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulator
kotlin
LumenRangeSlider("Capacity", capacity, { capacity = it },
    valueRange = 0f..100f, steps = 9, startLabel = "Minimum", endLabel = "Maximum",
    formatValue = { "${it.toInt()}%" })

Reference

Public API

The primary shared and platform-specific options exposed by LumenRangeSlider.

APIValues or typeDefaultDescription
label / value / onValueChangeString / ClosedFloatingPointRange<Float> / callbackRequiredNames and controls the numeric interval.
valueRangeClosedFloatingPointRange<Float>0f..1fProvides valid inclusive bounds.
stepsInt0Compose counts intermediate stops; Swift and React Native use positive increments.
startLabel / endLabel / formatValueString / String / (Float) -> StringMinimum / Maximum / numeric textLocalizes both endpoint names and values.
enabled / readOnlyBooleanEnabled / editableBlocks adjustment while retaining values.
onValueChangeFinished(() -> Unit)?nullReports the end of native adjustment.
modifierModifierNoneApplies control layout.

Native behavior

Design and accessibility

When to use it

Bounds must be finite, increasing, and have a finite span. Nonfinite values fall back to bounds; reversed endpoints reorder for display without changing host state. Keep exact financial arithmetic in the application.

Accessibility

Exposes separately named lower and upper native thumbs with formatted spoken values and keyboard adjustment.

Shared component

Available on other platforms

React NativeApple / SwiftUI
Android docsCompose module