Stepper

The Stepper UI component allows customers to increment or decrement numeric values seamlessly. Common usage includes adjusting quantities such as item counts.

Preview

Stepper.jpg

Code example

render('Checkout::Dynamic::Render', (props) => {
return <Stepper label="Quantity" max={5} min={0} step={1}></Stepper>;
});

StepperProps

tip

Optional properties are marked with a ?. Properties without a ? are required.

label

string

Describes the intent of the stepper, such as Quantity for specifying the quantity.


max

number

The maximum integer value allowed.


min?

number Default: 0

The minimum integer value allowed.


step?

number Default: 1

Increment value, a positive integer.


error?

string

Used to display error messages for customers to view.


disabled?

boolean Default: false

Indicates whether the stepper is disabled.

  • true: Disabled
  • false: Dvailable

readonly?

boolean Default: false

Indicates whether the field is read-only. Valid values are:

  • true: The field is read-only.
  • false: The field is editable.

prefix?

string

Text to display as a prefix, such as $ for currency symbols.


value?

number

The controlled numeric value.


defaultValue?

number

The uncontrolled initial numeric value.


onChange?

(value: number) => void

Triggered when the value changes.


onFocus?

() => void

Triggered when the input field gains focus.


onBlur?

() => void

Triggered when the input field loses focus.


Was this article helpful to you?