# Variation swatches

This feature comes with 2 elements "Swatches Loop" and "Swatches Single". They are meant to be used inside query loop for products and in product single template. They will change the appearance of products variants based on selected attribute type.

### Create and select type of attribute

Go to Woocommerce > Products > Attributes and create a new attribute. Make sure to select on of these types:

* Color
* Button
* Image

<figure><img src="/files/CBquImm4iXkWZWStuKoy" alt=""><figcaption></figcaption></figure>

Then add terms for your new attribute. Based on the selected type you might need to upload its image (image type) or select a color (color type).

### Display swatches in query loop (products)

In a query loop, add Swatches loop element. Select attributes you want to display:

<figure><img src="/files/OviyL90UK1fRvpLuxPJy" alt=""><figcaption></figcaption></figure>

Enter a class of container that contains this swatches loop element and everything related to this product, it is usually a product card container.

Then enter a class of product image so the image can be changed when the attribute option is selected (e.g. Yellow skirt has a different image).

### Display swatches in single template (products)

For this purpose we have "Swatches Single" element which has identical controls.

{% hint style="info" %}
If you want to use swatches in quick view popup (Popup), use Swatches Single element.
{% endhint %}


---

# 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://docs.brickstheme.com/basics/bricks-boilerplate-addon-plugin/variation-swatches.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.
