Next Commerce
Data AttributesCSS ClassesReference

CSS Class Reference

Every CSS class managed by the SDK, grouped by category.


Cart State

ClassApplied toWhen
next-in-cartElements with data-next-package-idThe package is currently in the cart
next-activeToggle buttons (data-next-toggle="cart")The toggle is in its "active" state (item is in cart)
.product-card.next-in-cart {
  border-color: #28a745;
  background: #f8fff9;
}

button[data-next-toggle].next-in-cart {
  background: red;
}

Selection State

ClassApplied toWhen
next-selectedSelector cardsCurrently selected card
next-selector-activeSelector containerThe container has at least one active selection
[data-next-selector-card].next-selected {
  border: 2px solid blue;
  background: #f0f8ff;
}

[data-next-cart-selector].next-selector-active .placeholder {
  display: none;
}

Action State

ClassApplied toWhen
next-loadingAction buttonsAn async action is in flight
next-disabledAction buttonsThe action cannot be triggered (no order, no selection, etc.)
button.next-loading {
  opacity: 0.6;
  cursor: wait;
}

button.next-disabled {
  opacity: 0.4;
  pointer-events: none;
}

The native disabled attribute is also added/removed alongside next-disabled.


Page Load State

ClassApplied toWhen
next-display-ready<html>After the SDK's first DOM scan completes
next-loading<html>While initial campaign data is loading
/* Hide displays until SDK is ready */
html:not(.next-display-ready) [data-next-display] {
  visibility: hidden;
}

See Loading States for the full skeleton pattern.


Order Load State

ClassApplied toWhen
next-loadedPage elements bound to order dataOrder successfully loaded from ?ref_id=
next-errorPage elements bound to order dataOrder failed to load
.order-content.next-loaded { display: block; }
.order-content.next-error  { color: red; }

Variant State (Bundle Selectors)

ClassApplied toWhen
next-variant-selectedVariant option elementOption is selected for that attribute
next-variant-unavailableVariant option elementCombination is unavailable

These are managed by BundleSelectorEnhancer. See Bundle Selector → Variants.


Bundle Selector State

ClassApplied toWhen
next-bundle-cardEach registered bundle cardOn registration
next-loadingBundle cardA price fetch is in flight for that card

See Bundle Selector → CSS.


Upsell State

ClassApplied toWhen
next-processingOffer container (data-next-upsell="offer")API call is in flight
next-successOffer containerAPI call succeeded; awaiting redirect
next-skippedOffer containerA skip button was clicked

See Upsells → CSS.


Class Override Attributes

Some enhancers let you replace the default class names. For example, on a bundle selector:

AttributeReplaces
data-next-class-selectednext-selected
data-next-class-in-cartnext-in-cart
data-next-class-bundle-cardnext-bundle-card

See the per-feature reference pages for the full list of class override attributes.

On this page