# Color and option swatches

Swatches help customers select variants (colors/materials) more easily. Customize them using:

* Images
* Hex color codes

#### Using Swatch Options

To show swatches on product pages/cards:

1. Update product's "Category" field
2. Add new option (Color/Material)
3. Connect option to a metafield
4. Customize each swatch:
   * Change hex code
   * Upload custom image

#### Using Swatch Filtering

Customize filters with Shopify Search & Discovery:

**Create Swatch Filter from Metafield**

1. Go to Shopify Settings > Custom Data
2. Create Metaobject Definition:
   * Name: "Swatch"
   * Add fields:
     1. Label (required): Single line text
     2. Color (optional): Color field
     3. Image (optional): Image file
3. Create Product Metafield:
   * Type: Metaobject (List of values)
   * Reference your Swatch metaobject
4. Assign values to products:
   * Edit product > Product Metafields
   * Add color/material options
5. Connect to filter:
   * Open Search & Discovery app
   * Add new filter using your metafield
   * Label it (e.g., "Color") and save

#### Important Notes

* You must manually update metafields for all products
* Changes don't happen automatically

**Filter by Color Option**

1. In Search & Discovery:
   * Add new filter
   * Select "Color" option
   * Save
2. For missing swatches:
   * Upload 64x64 JPG files
   * Name format: swatch-\[color].jpg (lowercase)
   * Only works with default CSS color names


---

# 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://help.brickspacelab.com/keystone/guides/sitewide/color-and-option-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.
