# Quantity Selector

Adds a quantity selector to a product:

```jsx
<QuantitySelector
  dataRef={content.productQuantitySelector}
  defaultType="secondary"
  defaultValue={1}
  minValue={1}
  maxValue={20}
/>
```

## Attributes

* **dataRef**: DataLocator - the data-element storing the Quantity Selector tag's configuration
* **defaultType**: string - The style of the buttons used with the control: either `"primary"` or `"secondary"` (Default: `"secondary"`)
* **defaultValue**: number - The default value for the Quantity Selector (Default: `1`)
* **minValue**: number - The minimum value of the Quantity Selector (Default: `1`)
* **maxValue**: number - The max value for the Quantity Selector (Default: `∞`)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.unstack.com/docs/e-commerce/quantity-selector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
