Speed Patterns octocat github link burger menu

Convert on Arrival

By Sergey Chernyshev · · Assisted by AI

Rich interactive components — carousels, tabbed panels, video players, maps, comparison sliders — are valuable, but they bring along a lot of code and data. Waiting for all of it to load before showing anything leaves the user staring at a blank container.

The Problem

A typical "above the fold" carousel illustrates the issue well. To work, it needs:

Until all of that arrives, the user either sees nothing, sees a spinner, or sees a janky half-loaded version that shifts as code initializes. Yet 90% of the visible value of a carousel is its first slide — the one the user sees on arrival.

Solution

The static placeholder ships in the first HTML response; the carousel "converts" into its full interactive form once the supporting code arrives, without changing size.

Two carousel panels side by side: the left shows a single static slide labeled 'Slide 1', the right shows the same panel as a fully interactive carousel with arrows, position dots and a counter '1 / 5'
Static first, interactive later

Render the simplest possible static representation of the component immediately, using only HTML and CSS. Then progressively enhance it into the full interactive version as the supporting code and data arrive.

For a carousel:

  1. Render the first slide as a plain image (or HTML block) at the correct dimensions
  2. Once the carousel JavaScript and remaining slides are downloaded, convert the static element into the full interactive carousel — without any layout shift
  3. The transition from static to interactive should be visually invisible to the user

The same pattern applies broadly:

Why This Works

The dominant use of an interactive component is often passive consumption of its default state. By optimizing for that default state, you get:

Guidelines

Related Patterns

Technical Implementation

Defer the upgrade until the page is no longer fighting for resources. Useful primitives:

The static placeholder should be authored as plain HTML at the correct final dimensions; the upgrade script then mounts the interactive version into (or in place of) that container without changing its size.