StepperInputState

class StepperInputState(val textFieldState: TextFieldState)(source)

State holder for Stepper.Input and Stepper.InputForm.

Wraps a TextFieldState and exposes the parsed integer value.

Parameters

textFieldState

The underlying text field state. Use rememberStepperInputState to create one with a saveable initial value.

Constructors

Link copied to clipboard
constructor(textFieldState: TextFieldState)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val value: Int?

The current parsed value, or null when the text field is empty or contains non-numeric text.

Functions

Link copied to clipboard
fun commitValue(range: IntRange)

Clamps value to range and writes it back to the text field. Clears the field when value is null.

Link copied to clipboard
fun decrement(step: Int, range: IntRange)

Decrements value by step, clamped to range, and writes the result to the text field. When value is null, snaps to range.first without applying the step.

Link copied to clipboard
fun increment(step: Int, range: IntRange)

Increments value by step, clamped to range, and writes the result to the text field. When value is null, snaps to range.first without applying the step.