> For the complete documentation index, see [llms.txt](https://docs.brickstheme.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brickstheme.com/basics/bricks-boilerplate-addon-plugin/variation-swatches.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.brickstheme.com/basics/bricks-boilerplate-addon-plugin/variation-swatches.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
