# Quantity Picker

> Stepper input for product quantity with increment / decrement buttons and direct keyboard entry.

## Playground

An interactive playground for QuantityPicker is embedded above. Open the canonical story on Storybook: [https://storybook.laioutr.cloud/?path=/story/ui-kit-molecules-quantitypicker--increment-value-one](https://storybook.laioutr.cloud/?path=/story/ui-kit-molecules-quantitypicker--increment-value-one)

## Overview

QuantityPicker is the quantity stepper used in the buybox and cart. It offers two ways to set a value: increment / decrement buttons for small adjustments, and direct keyboard entry for larger jumps (typing `12` is faster than tapping `+` twelve times). The component defaults to `1` and clamps to `minimumValue` / `maximumValue` (bind those to stock when you know it). Use `incrementValue` for bulk stepping (e.g. case packs of `6`).

Set `withDeleteButton` to swap the decrement icon to a trash icon once the value reaches the minimum, and listen for `@delete` to remove the line item entirely. That's the cart "remove last item" affordance.

## Key Business & UX Benefits

- Direct keyboard entry alongside +/- buttons removes friction for B2B and bulk buyers, who can grow average order value without rage-tapping the increment button.
- `maximumValue` tied to live stock stops customers from ordering quantities you can't fulfil, which protects the post-purchase experience and reduces refund volume.
- `withDeleteButton` plus the `@delete` event turns the cart row's quantity control into the line-item remove control too, so customers don't hunt for a separate "remove" button.
- `incrementValue` covers case-pack and bulk-order workflows in one component, so B2B and DTC storefronts share the same stepper.

<tip>

Pro-Tip from Larry: Bind `maximumValue` to available stock so the picker physically prevents customers from ordering more than inventory allows, and listen for `@delete` to remove the line item when the user clicks decrement at the minimum.

</tip>

## Feature List

<features :items="["Two entry modes: increment/decrement buttons for small bumps and direct keyboard entry for fast bulk jumps","`minimumValue` and `maximumValue` clamp the value, so binding `maximumValue` to live stock physically prevents over-ordering","`incrementValue` lets case-pack and bulk workflows step in 6s or 12s instead of 1s, covering B2B and DTC from one stepper","`withDeleteButton` swaps the decrement icon to a trash icon when the value reaches `minimumValue`","`@delete` event lets the same control double as the cart row's remove affordance, so customers don't hunt for a separate button","Default value of 1 keeps drop-in cart and buybox use trivial, no setup required"]">



</features>

## API Reference

#### Props

```json
{"type":"object","properties":{"size":{"enum":["s","m"],"type":"string","default":"m"},"minimumValue":{"type":"number","default":1},"maximumValue":{"type":"number","default":"Infinity"},"incrementValue":{"type":"number","default":1},"withDeleteButton":{"type":"boolean","default":false},"id":{"type":"string","default":"void 0"},"disabled":{"type":"boolean","default":false},"readonly":{"type":"boolean","default":false},"required":{"type":"boolean","default":false},"invalid":{"type":"boolean","default":false},"modelValue":{"type":"number"}}}
```

#### Events

```json
[{"name":"delete","description":"","tags":[],"type":"[]","signature":"(event: \"delete\"): void","schema":[]},{"name":"update:modelValue","description":"","tags":[],"type":"[value: number]","signature":"(event: \"update:modelValue\", value: number): void","schema":["number"]}]
```
