Variant menu styling reference
On this page
The variant menu is the menu that opens over a product card when operators tap a product that has variants, such as sizes or colors, or a variable price. Each step of the variant menu has a heading and a list of options to tap. You can change the height and fill of the options, the text, the variant pictures, the row for typing a custom price, etc. Follow the POS styling API rules when you style the variant menu.
Where the variant menu appears
The variant menu opens over a product card in these places:
- In a products grid
- In an action grid
- In the bundle dialog, over the products in a bundle
The steps in the variant menu depend on the product:
- A product with one kind of variant shows one step.
- A product with two kinds of variant and few combinations shows every combination in one step, such as Blue · Large.
- Any other product with variants shows a step for each kind, with the choices made so far above it.
- A product with a variable price shows a price step last, with the preset prices and Custom… to type a price.
Every step uses the same variant menu parts, so CSS you write for the variant menu styles every step.
Parts
| Part | What it is | Available from |
|---|---|---|
variant-menu-root |
The whole menu that opens over a product card to pick a variant, then a price when the product has a variable price, inside the card’s overlay. | v22.0.19 |
variant-menu-header |
The top of the menu, above the options, with the picks made so far and what to pick now. | v22.0.19 |
variant-menu-selections |
The picks made on earlier steps, such as Blue · Large, when there is more than one step. | v22.0.19 |
variant-menu-heading |
What to pick now, such as Select size or Select a price. | v22.0.19 |
variant-menu-options |
The list of options under the header. | v22.0.19 |
variant-menu-option |
One option: a variant, a combination of variants, a preset price, or Custom… to type a price. | v22.0.19 |
variant-menu-option-label |
The name of an option, such as Large, Blue · Large, or a preset price. | v22.0.19 |
variant-menu-option-price |
What a variant costs, after the name, when the price is known and no price step follows. | v22.0.19 |
variant-menu-custom-price |
The row that takes the place of Custom… once it is pressed, with a field for the price and a button to confirm it. | v22.0.19 |
variant-menu-custom-price-field |
The field to type a custom price in. | v22.0.19 |
variant-menu-custom-price-confirm |
The button with a checkmark that confirms a custom price, disabled until the price is valid. | v22.0.19 |
The Available from column shows the first release that carries the name.
Attributes
Narrow variant-menu-option by this, inside :where(), to style the option that is picked.
| Attribute | Values | Default | Available from |
|---|---|---|---|
variant-menu-option[aria-checked] |
true, false |
false |
v22.0.19 |
true: the option already picked on this step, when the menu opens on a product whose variants are already chosen, such as a bundle’s component.false: any other option, including every price.
Component properties
Set these on variant-menu-root, or on :root to change every variant menu.
| Property | What it sets | Default | Available from |
|---|---|---|---|
--sc-variant-menu-option-height |
How tall an option is. | 44px | v22.0.19 |
--sc-variant-menu-image-radius |
How round the corners of an option’s image are. | var(–sc-spacing-1) | v22.0.19 |
Before v22.0.19, the menu read --sc-variants-menu-button-height and --sc-variants-menu-image-radius. It still reads them when the names above aren’t set, until v24.0.0.
Examples
Each example is tested against the POS on every change.
“Make the options taller.”
```css
[part~=’variant-menu-root’] { –sc-variant-menu-option-height: 52px; } ```
“Show which option is picked with a light fill.”
```css
background-color: #e8f0fe; } ```
“Make the pictures of the variants round.”
```css
[part~=’variant-menu-root’] { –sc-variant-menu-image-radius: 50%; } ```
“Make what to pick larger.”
```css
[part~=’variant-menu-heading’] { font-size: 16px; } ```
“Show the variants’ prices in our brand color.”
```css
[part~=’variant-menu-option-price’] { color: #0b5394; } ```
“Fill the button that confirms a custom price with our brand color.” The fill also shows while the button is disabled, before the price is valid. To style the disabled button differently, follow this rule with one for [part~='variant-menu-custom-price-confirm']:disabled.
```css
[part~=’variant-menu-custom-price-confirm’] { background-color: #0b5394; color: #ffffff; } ```
What can’t be styled yet
- An option’s image alone, which is a media image with no name here: use the properties above, or a property on
media-image-root, which reaches every image in the POS - The variant steps apart from the price step
- The message under a custom price that’s out of range, such as Minimum is $5
- The overlay on the product card that holds the menu, with the fill, corners, and shadow
Retired
None yet.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.