InputStepper

An input stepper is a two-segment UI control used to incrementally increase or decrease a numeric value.

Simple InputStepper

Sizes

To have the larger or smaller switches, use the size property.

Controlled InputStepper

You can use the value, and onChange properties to control the behaviour of the stepper.

The value is
"0"

API

Learn more about the properties and the customization points.

Usage

import InputStepper from "@sonnat/ui/InputStepper";
//or
import { InputStepper } from "@sonnat/ui";

Properties

Note that the documentation avoids mentioning all the native props (there are a lot) in this section of the components.

InputStepper Properties
NameTypeDefaultDescription
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
namestring-The name of the stepper.
valuenumber-The value of the stepper. The DOM API casts this to a string.
defaultValuenumber-The default value. Use when the component is not controlled.
size"large"
| "medium"
| "small"
"medium"The size of the stepper.
disabledbooleanfalseIf true, the field will be disabled.
fluidbooleanfalseIf true, the field will be fluid (max-width: 100%)
minnumber0The minimum value the stepper can hold.
maxnumberInfinityThe maximum value the stepper can hold.
inputPropsobject-The properties applied to the input element.
onChangefunction-The callback fires when the state has changed.
Signature: function(value: number) => void
onAddfunction-The callback fires when the add button has been clicked.
Signature: function(value: number) => void
onSubtractfunction-The callback fires when the subtract button has been clicked.
Signature: function(value: number) => void
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.