<dkl-discount-badge> tag written directly into your theme’s Liquid.
On a product page it needs zero attributes — it paints from the page product’s carrier
and renders the badge.
Usage
On a product page, add the<dkl-discount-badge> web component — it renders the primary product’s badge:
Reacting to changes
<dkl-discount-badge> emits no events — it re-renders its own text in place on a variant
change. To run your own code when the badge updates, watch the element with a
MutationObserver — see React to badge updates in the examples below.
Examples
For the full list ofdata-* attributes you can set, see
Styling & Data Attributes.
Whichever discount saves more
Override attributes + tokens
React to badge updates
Next steps
Styling & Data Attributes
Every
data-* attribute and --dkl-badge-* token.App block
The no-code, theme-editor placement.