ProductVariationSelect
One choice on a product page with its name shown: a hairline, the label, and the options of the variant selector.
In Figma: Product Variation Select (node 2100:689). In code: components/ui/product-variation-select.tsx
Example
import { ProductVariationSelect } from '@/components/ui/product-variation-select';
<ProductVariationSelect
label="Størrelse"
name="size"
defaultValue="L"
options={[{ value: 'S', label: 'S' }, { value: 'M', label: 'M' }, { value: 'L', label: 'L' }]}
more={9}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
label (required) | string | What is being chosen, such as "Størrelse". Shown above the options and read aloud as the name of the group. | |
...picker | VariationPickerProps | Everything VariationPicker takes: name, options, value, defaultValue, onChange, more, moreHref, moreLabel. |
Do
- Use one per choice on a product page: one for colour, one for size.
- Stack them; each brings its own hairline.
Do not
- Do not use it in a listing or a card. There the options stand alone, as VariationPicker.
- Do not add a second label above it.
Accessibility
- The label is shown once for the eye and read once as the name of the radio group.
- Everything else is VariationPicker: native radio buttons, arrow keys, a form post.
Tokens it uses
- color.border.default
- color.text.default
- type.body.sm
- space.inline.1
- space.inline.3