We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Display tooltips in swatches picker

Solved

Display tooltips in swatches picker

danielrzg
Visitor
2 0 0

I am looking for a way to display tooltips when hovering over my variant swatches on the product page. The swatches have images for each variant and not just colors, I would like for the variant title to be displayed as tooltips. 

 

I am using Atelier theme, one of the new Horizon themes.

Accepted Solution (1)

AiTrillion
Shopify Partner
4265 250 752

This is an accepted solution.

Hi @danielrzg ,

 

  1. Go to your Shopify admin → Online Store → Themes → Actions → Edit code

  2. Find the main CSS file (typically theme.css, base.css, or global.css) in the Assets folder

  3. Add this CSS at the end of the file:

    /* Variant swatch tooltips */
    .variant-swatch {
    position: relative;
    display: inline-block;
    }

    .variant-swatch:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
    }

    .variant-swatch:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
    margin-bottom: 0;
    z-index: 11;
    }

  4. Find the variant swatch template (likely in product-card.liquid, product-info.liquid, or similar)
  5. Ensure each swatch has the data-title attribute with the variant title:
    <div class="variant-swatch" data-title="{{ variant.title }}" style="background-image: url('{{ variant.image.src | img_url: '50x50' }}')"></div>

    It will show like this (Please check the below image)

    AiTrillion_0-1750783890850.png

     

    If you stuck somewhere, Feel free to DM me anytime and I will be more than happy to help you!

Sachin D | Shopify Growth Expert @ AiTrillion

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- 10+ Years of eCommerce experience.
- 1400+ Stores Designed on Shopify.
- All in One Marketing App on Shopify AiTrillion Marketing Automation
.
- 13+ Shopify Apps launched on app store.

View solution in original post

Replies 4 (4)

JakeJ
New Member
7 0 0

To display tooltips with variant titles on image swatches in the Atelier (Horizon) theme, add the title attribute to each swatch label in your theme’s code.

Steps:

  1. Go to Online Store > Themes > Edit Code.

  2. Locate the swatch snippet (e.g., variant-swatch.liquid).

  3. In the swatch <label>, 

Message me to get it done for you

AiTrillion
Shopify Partner
4265 250 752

This is an accepted solution.

Hi @danielrzg ,

 

  1. Go to your Shopify admin → Online Store → Themes → Actions → Edit code

  2. Find the main CSS file (typically theme.css, base.css, or global.css) in the Assets folder

  3. Add this CSS at the end of the file:

    /* Variant swatch tooltips */
    .variant-swatch {
    position: relative;
    display: inline-block;
    }

    .variant-swatch:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
    }

    .variant-swatch:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
    margin-bottom: 0;
    z-index: 11;
    }

  4. Find the variant swatch template (likely in product-card.liquid, product-info.liquid, or similar)
  5. Ensure each swatch has the data-title attribute with the variant title:
    <div class="variant-swatch" data-title="{{ variant.title }}" style="background-image: url('{{ variant.image.src | img_url: '50x50' }}')"></div>

    It will show like this (Please check the below image)

    AiTrillion_0-1750783890850.png

     

    If you stuck somewhere, Feel free to DM me anytime and I will be more than happy to help you!

Sachin D | Shopify Growth Expert @ AiTrillion

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- 10+ Years of eCommerce experience.
- 1400+ Stores Designed on Shopify.
- All in One Marketing App on Shopify AiTrillion Marketing Automation
.
- 13+ Shopify Apps launched on app store.

CodingFifty
Shopify Partner
1102 161 190

Hey! @danielrzg,

 

To show tooltips on hover for your image-based variant swatches in the Atelier theme, you can add a `title="{{ value }}"` attribute to each swatch image in your theme's code (usually in a snippet like `product-variant-options.liquid`). This will display the variant title as a default browser tooltip when users hover over the image. If you prefer a more styled tooltip instead of the default, you can use a bit of custom CSS and JavaScript to create a nicer floating label.

Coding Fifty || Shopify Partner
For any custom section queries, please visit: Fiverr Profile
Found my response useful? Like it and mark as Accepted Solution!
For additional discussions, reach out via: Email ID: codingfifty@gmail.com

Easify-Jennifer
Explorer
71 2 4

Hi @danielrzg 

If you're looking to show tooltips with the variant titles when hovering over image swatches, a great solution would be to use Easify Product Options. It supports both image swatches and tooltips, so you can easily display the variant name when customers hover over each option — no custom coding needed.

If you’d like to try an app to make things easier, this could be a really smooth option to consider! Here's how it works:

  • This is the result:

EasifyJennifer_2-1750921868751.png

 

  • This is the app setting:

EasifyJennifer_1-1750921496631.png

 

To show tooltip for variants like my demo, simple click add/ edit value description:

 

EasifyJennifer_4-1750922192687.png

 

EasifyJennifer_3-1750921993458.png

 

I hope this answer helps solve the problem. If you need further assistance, feel free to reach out to Easify anytime! 🤗