Stepper allows users to make a selection from a range of values.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

Stepper

Android
@Composable
public fun Stepper(
    value: Float,
    onValueChange: (Float) -> Unit,
    steps: Int,
    decreaseIcon: @Composable () -> Unit,
    increaseIcon: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    valueRange: ClosedFloatingPointRange<Float> = 0f..(steps + 1).toFloat(),
    colors: StepperColors = StepperDefaults.colors(),
    content: @Composable BoxScope.() -> Unit,
)

Parameters

value Current value of the Stepper. If outside of valueRange provided, value will be coerced to this range.
onValueChange Lambda in which value should be updated.
steps Specifies the number of discrete values, excluding min and max values, evenly distributed across the whole value range. Must not be negative. If 0, stepper will have only min and max values and no steps in between.
modifier Modifiers for the Stepper layout.
decreaseIcon A slot for an icon which is placed on the decrease (bottom) button.
increaseIcon A slot for an icon which is placed on the increase (top) button.
enabled Whether the Stepper is enabled.
valueRange Range of values that Stepper value can take. Passed value will be coerced to this range.
colors StepperColors that will be used to resolve the colors used for this Stepper. See StepperDefaults.colors.
content Content body for the Stepper.

Stepper

Android
@Composable
public fun Stepper(
    value: Int,
    onValueChange: (Int) -> Unit,
    valueProgression: IntProgression,
    decreaseIcon: @Composable () -> Unit,
    increaseIcon: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    colors: StepperColors = StepperDefaults.colors(),
    content: @Composable BoxScope.() -> Unit,
)

Parameters

value Current value of the Stepper. If outside of valueProgression provided, value will be coerced to this range.
onValueChange Lambda in which value should be updated.
valueProgression Progression of values that Stepper value can take. Consists of rangeStart, rangeEnd and step. Range will be equally divided by step size.
modifier Modifiers for the Stepper layout.
decreaseIcon A slot for an icon which is placed on the decrease (bottom) button.
increaseIcon A slot for an icon which is placed on the increase (top) button.
enabled Whether the Stepper is enabled.
colors StepperColors that will be used to resolve the colors used for this Stepper. See StepperDefaults.colors.
content Content body for the Stepper.