remold/ui

Quantity stepper

An add-to-cart button that becomes a quantity stepper: the count rolls up and down, and at one the minus becomes a bin, so the next press folds it back into Add.

Base UIMorph

iPhone 17 Pro256 GB · Deep Blue · £1,099

Things to try

  • Press Add. The button stretches into minus, count and plus.
  • Count up and down. The number rolls like a counter.
  • Go back to one. The minus becomes a bin; press it and the stepper folds back into Add.

Install

npx shadcn@latest add https://your-docs-site/r/quantity-stepper.json

Dependencies

The install command adds these for you. If you copy the code by hand, install them yourself.

npm install @base-ui/react @hugeicons/core-free-icons @hugeicons/react @remold-ui/react motion

How it works

  • Built on Base UI. NumberField gives increment, decrement, the arrow keys and the min and max.
  • The button becomes the stepper. Both share a Motion layoutId. The minus reshapes into the bin with Remold.Icon, and the count rolls with the Odometer.
The product picture is an illustration.

On this page