React

Quantity Picker

A component used to increase or decrease quantity in integer units.

Available since@seed-design/react@2.1.0, @seed-design/css@2.3.0

Installation

npx @seed-design/cli@latest add ui:quantity-picker

Props

Prop

Type

Examples

Layout

Available since@seed-design/react@2.2.0, @seed-design/css@2.4.0

layout="hug" maintains the original width to fit the content. If the parent is a Flex layout and you need to fill the remaining space, use layout="fill". In this case, the button sizes on both sides are maintained and only the Value Display area expands.

Value Text

Using getValueText, you can add units or supplementary descriptions to the displayed quantity.

Controlled

You can control the quantity state externally using value and onValueChange.

Removable

When you use removable, the Decrement button switches to a Remove button when the value reaches min. Handle the removal action in onRemove.

Loading

With loading, you can temporarily prevent all actions or specific actions and display a loading indicator.

Form

When you pass name to inputProps, the current quantity is submitted as a hidden input.

Accessibility

Provide an aria-label or aria-labelledby to the Root that describes the purpose of Quantity Picker. If needed, you can change the accessibility name of each action contextually using decrementAriaLabel, incrementAriaLabel, and removeAriaLabel.

Using getValueText, you can provide the ValueDisplay number as human-readable text. This value does not affect the raw integer value submitted to the hidden input.

Table of contents