Stylish Number Input
A numeric stepper input combining a text field with minus/plus buttons, for choosing an integer within range.
The value is hoisted — the caller owns the state via value and onValueChange. The field allows free typing: each edit is parsed as an Int (and coerced into range); edits that do not parse are rejected and the field snaps back to the previous value. The minus and plus buttons step the value by step and disable automatically at the bounds of range or when enabled is false. Since the field (through StylishFormTextField) is a Material 3 outlined text field, it carries M3's built-in focus indicator and error outline.
The field is wrapped in StylishFormTextField, which lays out label, supporting text, and error message below the field; the steppers flank it left and right. Use leadingIcon / trailingIcon for icons inside the field (e.g. a currency symbol or unit), which are independent of the steppers.
Testing
The root carries the default test tag stylish_numberinput for UI tests. Callers can override it by passing their own Modifier.testTag(...) in modifier.
Parameters
The current integer value (controlled state).
Called with the new value on every accepted edit and on every stepper tap. Values are coerced into range before being reported.
Modifier applied to the root Row.
When false, the field rejects input and the steppers are disabled.
The allowed value range. Steppers disable at the bounds; typed values are coerced into the range. Defaults to 0..Int.MAX_VALUE.
The amount added or removed by one stepper tap. Defaults to 1.
Label displayed above the field. Defaults to "", which renders no label region.
When true, the field renders its error outline color.
Error text displayed below the field in the error color.
Optional icon slot at the start of the field (the minus stepper sits outside the field).
Optional icon slot at the end of the field (the plus stepper sits outside the field).
Typography for the input text. Defaults to MaterialTheme.typography.bodyLarge.
Shape of the field's outlined border. Defaults to RoundedCornerShape with DefaultStylishDimensions.connectedCornerRadius.
Color scheme for the field. Defaults to OutlinedTextFieldDefaults.colors().
The MutableInteractionSource for the field, used to observe focus/press/hover interactions. When null, an internal one is remembered.