Next Commerce
UtilitiesLoading States

Loading States

The SDK takes a moment to fetch campaign data and render display values. Loading states give you a way to show skeletons or placeholders during that gap so the page does not flicker.

How It Works

  1. Before the SDK finishes initializing, the <html> element does not have the next-display-ready class.
  2. You apply skeleton styles to elements that need to wait — typically with the [data-next-skeleton] attribute.
  3. After the SDK finishes its first DOM scan, it adds next-display-ready to <html>.
  4. Your CSS hides the skeletons (or shows the real content) once that class is present.

This is a CSS-only pattern. There is no JavaScript hook to wait for — the SDK adds the class, and your stylesheet does the rest.

On this page