Description Dynamically loads more documents recommended for the user.
Availability Experimental (Document opt-in allowed)
Required Script <script async custom-element="amp-next-page" src="https://cdn.ampproject.org/v0/amp-next-page-0.1.js"></script>
Supported Layouts N/A

Behavior

Given a list of pages, amp-next-page tries to load them after the current document, providing an infinite-scroll type experience.

The pages should be inlined using a JSON format.

<amp-next-page>
  <script type="application/json">
    {
      "pages": ...
    }
  </script>
</amp-next-page>

If loading the next document is successful, everything after the placement of amp-next-page is removed from the current document. Typical use would be to include amp-next-page directly after the unique content of a given page: for example, at the end of a news article or recipe, but before the footer or other content repeated across articles.

Attributes

N/A

Common attributes

This element includes common attributes extended to AMP components.

Configuration Spec

The configuration defines the documents recommended by <amp-next-page> to the user.

Example Configuration

The following configuration will only recommend one more document for the user to read.

{
  "pages": [
    {
      "image": "http://example.com/image1.jpg",
      "title": "This is one another article",
      "ampUrl": "http://example.com/article1.amp.html"      
    }
  ]
}

Validation

See amp-next-page rules in the AMP validator specification.