Skip to content

CartInput

Props

API reference for CartInput. For usage examples, see the React tab.

NameTypeDefault
commitBehavior"snap" | "validate"'snap'

Controls the behavior of the number field when the user blurs the field after editing. 'snap' will clamp the value to the min/max values, and snap to the nearest step value. 'validate' will not clamp the value, and will validate that the value is within the min/max range and on a valid step.

decrementAriaLabelstring"Decrease quantity"

A custom aria-label for the decrement button.

descriptionstring

Adds a description to the input.

formatOptionsNumberFormatOptions

Formatting options for the value displayed in the number field. This also affects what characters are allowed to be typed by the user.

incrementAriaLabelstring"Increase quantity"

A custom aria-label for the increment button.

isDisabledboolean

Whether the input is disabled.

isInvalidboolean

Whether the input value is invalid.

isReadOnlyboolean

Whether the input can be selected but not changed by the user.

isRequiredbooleanfalse

Sets the input to a required state.

isWheelDisabledboolean

Enables or disables changing the value with scroll.

labelstring

Adds label for the input.

maxValuenumber

The largest value allowed for the input.

minValuenumber0

The smallest value allowed for the input.

size"lg" | "md" | "sm"md

Size of the cart input controls.