# variant-selector

> Native select whose options are the values of a product option.

Status: Ready (Smootify 2.0)  
URL: https://www.smootify.io/docs/astro/reference/elements/variant-selector  
Updated: 2026-10-21

## Where it can go

- **Inside** [`smootify-product`](https://www.smootify.io/docs/astro/reference/elements/smootify-product).
- **Not inside** an element with `hidden` at boot: it does not mount.
- **Must contain** `select`.
- **Out of place,** Smootify removes it from the page: also when its option is missing or Default Title.

## What it requires

Nothing beyond Smootify: it works on every plan.

## Attributes on the element

- **It reads** `data-option`, `data-option-name`.
- It reads `allow-unavailable` on [`smootify-add-to-cart`](https://www.smootify.io/docs/astro/reference/elements/smootify-add-to-cart).
- **Smootify writes** `role`, `aria-label` on it: do not set them yourself.

## Attributes inside it

| Group | Attribute name | Values |
|---|---|---|
| [Selected value](https://www.smootify.io/docs/astro/reference/attributes/selected-option) | `selected-option` | 5 |

## Loading

Its code loads only on pages that have `variant-selector`.
