Skip to content
Docs

Styling & Data Attributes

This is the shared reference for <dkl-tiered-rewards> — the data-* attributes that drive its behaviour, the --dkl-tr-* tokens that style it, and the Light-DOM classes you can target. A component writes these for you; on a web component you set them directly.

All optional. The tiers, the cart total, the money format and whether the goal counts items come from the carrier, so only the attributes you set are listed.

metaobject handle · default: first eligible

Pick a specific tiered rewards discount’s carrier. The discount- prefix is optional; place one tag per discount to show several.

component handle · default: none (built-in styling)

Use a component built in Discount Kit → Components: its discount, colours, text and icons come with it.

Each tier gives one reward — an order discount, a shipping discount or a free gift — and each kind has its own message and tier label. In every message, [amount] is how much more to spend (or how many more items to add, for a goal measured in items) and [discount] is the reward’s percent or amount.

string · default: Add [amount] more to save [discount] on your order!

The next-goal message when the next tier is an order discount.

string · default: Add [amount] more to save [discount] on shipping!

The next-goal message when the next tier is a shipping discount.

string · default: Add [amount] more to get free shipping!

The next-goal message when the next tier is free shipping.

string · default: Add [amount] more to get a free gift!

The next-goal message when the next tier is a free gift.

string · default: Winner Winner 🎉

Heading shown once every tier is met.

string · default: You've unlocked all available savings

Content shown once every tier is met.

string · default: Save [discount]

Tier label for an order discount; [discount] is the placeholder.

string · default: [discount] off shipping

Tier label for a shipping discount; [discount] is the placeholder.

string · default: Free shipping

Tier label for free shipping.

string · default: Free gift

Tier label for a free gift.

string · default: [amount]+

Per-tier spend line, e.g. $75.00+; [amount] is the placeholder.

string · default: [amount]+ items

Per-tier line for a goal measured in items, e.g. 3+ items; [amount] is the item count.

"horizontal" | "stacked" · default: horizontal

Layout variant. stacked arranges markers in a column with the progress bar rotated. A discount with more than 3 tiers is stacked, because the horizontal layout’s markers share one row. Set data-keep-layout to override that.

"true" · default: unset

Keep data-layout whatever the tier count, so a discount with more than 3 tiers can still be shown horizontally. Its labels get narrow, so check it at your theme’s widths.

<dkl-tiered-rewards data-layout="horizontal" data-keep-layout="true"></dkl-tiered-rewards>

<dkl-tiered-rewards> is styled by a stylesheet loaded site-wide by the embed. Set any token above the element (:root, the Custom CSS in Components → Styles, an inline style, or the block’s scoped rule).

default: 0

Space above the widget (block Margin top).

default: 0

Space below the widget (block Margin bottom).

default: var(--dkl-color-background-soft)

Card background (block Background color).

default: 1rem

Card padding (block Padding).

default: var(--dkl-radius)

Card corners (block Border radius).

default: 16px

Progress message (first line).

default: 14px

Second line of the message (the success message under its heading).

default: 14px

Tier save label.

default: 12px

Tier spend label.

Each text element has its own size token and a fixed pixel default — there is no shared base size. To vary one per breakpoint, set its token inside your own media query.

default: var(--dkl-color-text)

Card text colour (block Text color).

default: inherit

The “Save [discount]” tier label (block Tier label color).

default: inherit

The “[amount]+” tier line (block Tier spend label color).

default: var(--dkl-color-border)

Progress track (unfilled bar) colour (block Track color).

default: var(--dkl-color-accent)

Progress fill colour (block Progress bar color).

default: 2rem

Tier marker size.

default: var(--dkl-color-border)

Inactive marker border colour.

default: var(--dkl-color-background)

Inactive marker fill (block Icon background (not met)).

default: var(--dkl-color-accent)

Active (met) marker fill (block Icon background (met)).

default: #ffffff

Active marker check-icon colour.

Each marker shows the icon for its reward, and a met tier shows a check. Replace any of them with an image: a component’s Icons settings pick one from your store’s Files (square, 128 × 128 px, SVG or transparent PNG), and on a web component you set the token to a url(). An image is drawn in full colour; unset, the built-in icon is drawn in the marker icon colour.

dkl-tiered-rewards {
--dkl-tr-icon-gift: url("https://cdn.shopify.com/s/files/1/0000/0001/files/gift.png");
}

A percentage order discount. Default: a % sign.

A fixed-amount order discount. Default: a banknote.

A shipping discount, free or not. Default: a delivery van.

A free gift. Default: a gift box.

Any tier that’s been met. Default: a check.

<dkl-tiered-rewards> is all light DOM — no parts. Target these classes directly.

host

The card (host element).

class

The headline / progress message.

class

The progress bar (with .dkl-tiered-rewards__progress-track; the fill is the track’s ::before).

class

The tier row/column.

class

The wrapper for each tier.

class

The marker dot (met: .dkl-tiered-rewards__tier-marker--active; the icon glyph is its ::before).

class

The wrapper for the tier label.

class

The “Save [discount]” text in the tier label.

class

The “[amount]+” text in the tier label.

Restyle the progress fill and markers
:root {
--dkl-tr-progress-color: #6d28d9;
--dkl-tr-marker-active-color: #6d28d9;
--dkl-tr-track-color: #ede9fe;
}
.dkl-tiered-rewards__tier-marker--active {
box-shadow: 0 0 0 3px #ede9fe;
}
Custom messaging
<dkl-tiered-rewards
data-spend-more-message="Add [amount] more for [discount] off!"
data-success-heading="You did it! 🎉"
data-success-message="Every reward unlocked"
data-tier-save-label="[discount] off"
data-tier-spend-label="at [amount]+"
></dkl-tiered-rewards>