Rubik Combined Listings

Show a "New" badge on new products Rubik Combined Listings Swatch

← Back to documentation

Overview

A "New" badge tells shoppers which color, style or size in a group was added recently. The swatches know how long ago each product was published on your store, so the badge needs no tags and no upkeep: it appears when a product is published and goes away on its own once the product is no longer new.

There are two ways to add it. Both give the same result, on product pages and on product cards:

A row of six leggings swatches on a product page. The pink leggings swatch carries a small black New badge in its top right corner.
The pink leggings were published this week, so their swatch carries the badge

How it works

Every swatch carries the time windows its product was published within. There are five windows: the last 7, 14, 30, 60 and 90 days. You pick the window that means "new" for your store, and the badge shows on the swatches inside it.

New means published in the last CSS selector
7 days .rcl__swatch[data-published-within~="7"]
14 days .rcl__swatch[data-published-within~="14"]
30 days .rcl__swatch[data-published-within~="30"]
60 days .rcl__swatch[data-published-within~="60"]
90 days .rcl__swatch[data-published-within~="90"]

The date is the day the product was published to your online store, the same date the Push new products to the start sorting rule uses. A product that sat in drafts for a month counts from the day you published it, not from the day you created it.

Option 1: ask the AI assistant

  1. Open the product group in the app.
  2. Under the swatch preview, type your request in the field Ask AI to change design of your swatches and press Enter. The assistant opens, makes the change and shows you the result in the preview.
  3. Keep talking to it until the badge looks the way you want, then click Apply changes and save the group.

An example conversation, with the preview after each answer:

YouShow a new badge on the products created in the last 7 days

AI assistantOn the product page, a "New" badge now appears on swatches for products published within the last 7 days. The preview shows it on Pink.

Swatch preview after the first answer: a black New badge in the top right corner of the pink leggings swatch.

YouShow it on the bottom of the swatch

AI assistantThe "New" badge now sits at the bottom of the swatch on the product page.

Swatch preview after the second answer: the New badge moved to the bottom right corner of the pink leggings swatch.

YouStretch it to full width and make it transparent

AI assistantOn the product page, the "New" badge now stretches across the bottom of the swatch with a translucent background.

Swatch preview after the third answer: the word New on a translucent dark strip across the bottom of the pink leggings swatch.

More things you can ask for:

The assistant changes one version of the swatches at a time: the product page or the product cards, on desktop or mobile. It tells you which one it changed, and you can ask it to repeat the badge on the others. If you ask for a window that does not exist, for example 10 days, it uses the nearest one and says which.

The assistant writes the same CSS as the examples below and puts it into the group's Custom CSS field, where you can read it, edit it or delete it.

Option 2: add the CSS yourself

Paste one of the examples into a custom CSS field:

Every example uses the 7 day window. Change ~="7" to another window from the table above, and change the text after content: to your own wording.

Badge in the corner

Square photo swatches. The new product's swatch has a small black New badge in its top right corner.
:host .rcl__swatch[data-published-within~="7"] {
    position: relative;
}

:host .rcl__swatch[data-published-within~="7"]::after {
    content: "New";
    position: absolute;
    top: 3px;
    right: 3px;
    padding: 2px 4px;
    border-radius: 3px;
    background: #111111;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

Strip across the bottom

Square photo swatches. The new product's swatch has the word New on a translucent dark strip across its bottom edge.
:host .rcl__swatch[data-published-within~="7"] {
    position: relative;
}

:host .rcl__swatch[data-published-within~="7"]::after {
    content: "New";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3px 0;
    text-align: center;
    background: rgba(17, 17, 17, 0.5);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

Round swatches

A round swatch cuts off anything in its corners, so center the badge along the bottom or the top edge.

Round photo swatches. The new product's swatch has a black pill with the word NEW centered at its bottom.
:host .rcl__swatch[data-published-within~="7"] {
    position: relative;
}

:host .rcl__swatch[data-published-within~="7"]::after {
    content: "NEW";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 5px;
    border-radius: 8px;
    background: #111111;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.3px;
}

Button swatches

On buttons the badge reads best as a small tag after the label.

Button swatches with the option names as text. The Pink button has a small orange New tag after its label.
:host .rcl__swatch--button[data-published-within~="7"]
    .rcl__button-label::after {
    content: "New";
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 8px;
    background: #c2410c;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    vertical-align: middle;
}

A dot for small swatches

Product card swatches are often too small for a word. A dot says the same thing in a few pixels.

Small round color swatches as shown on a product card. The pink swatch has a red dot with a white ring near its top edge.
:host .rcl__swatch[data-published-within~="7"] {
    position: relative;
}

:host .rcl__swatch[data-published-within~="7"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e11d48;
    box-shadow: 0 0 0 2px #ffffff;
}

What the preview shows

The swatch preview in the app shows the badge on the same products as your store, using each product's real publish date.

Good to know

Related guides