Black Friday: 30% off Pro

Get 30% off

Updated

Stepper Button

Preview

Customize

Max9
Solid
Medium
Radius12px

Installation

npx shadcn@latest add https://uibrik.com/r/stepper-button.json
Adds the files to components/uibrik/stepper-button and installs @number-flow/react, @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/stepper-button.

Usage

import { StepperButton } from "@/components/uibrik/stepper-button/stepper-button";​<StepperButton  label="Add to cart"  max={9}  variant="solid"  size="md"  trashAtOne  radius={12}  defaultValue={0}  onChange={(quantity) => {}}/>

Where to use Stepper Button

  • Add to cart

    An add button reshaping into a quantity stepper in the same pill saves space.

    Pairs with Cart Flight

  • Grocery and food apps

    Adjusting quantity right on the product card speeds up ordering.

  • Ticket quantities

    The same pill works for seats and tickets.

Props

StepperButton
label
Type string
"Add to cart"
Button text.
max
Type number
9
Highest quantity allowed.
variant
Type "solid" | "soft" | "outline"
"solid"
Primary, or a quieter look.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
trashAtOne
Type boolean
true
At one, show a trash icon in place of minus, since the next tap removes it.
radius
Type number
12
Corner radius.
defaultValue
Type number
0
Starting quantity. 0 shows the add button.
onChange
Type (quantity: number) => void
–
Called with the new quantity after each change.
className
Type string
–
Classes for the wrapper.