Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Android docs
FormsAndroid

Slider

Adjust a continuous or stepped numeric value with a visible formatted label.

Public APILumenSliderAndroid / Compose

Native example

Use Slider

Use for an approximate or continuously adjustable numeric value. Prefer TextField or Picker when exact entry is more important.

Slider rendered in the Android phone emulator Lumen playground
Verified runtime captureAndroid phone emulator
kotlin
LumenSlider(
    label = "Minimum speed",
    value = minimumSpeed,
    onValueChange = ::setMinimumSpeed,
    valueRange = 1_000f..5_000f,
    steps = 39,
    valueLabel = "${minimumSpeed.toInt()} RPM"
)

Reference

Public API

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

APIValues or typeDefaultDescription
valueFloatRequiredStores the current numeric value.
valueRangeClosedFloatingPointRange<Float>RequiredDefines the valid range.
stepsInt0Adds valid stepped increments when positive and finite.
valueLabelStringvalue.toString()Shows a formatted current value.

Native behavior

Design and accessibility

When to use it

Use for an approximate or continuously adjustable numeric value. Prefer TextField or Picker when exact entry is more important.

Accessibility

The native slider reports its label and current value. A visible formatted value helps people understand the current setting.

Shared component

Available on other platforms

React NativeApple / SwiftUI
Android docsCompose module