Previous and next

Links to the previous and next page of a guide, in the order of its menu.

When to use it

The previous and next page of a guide or a tutorial, at the end of each page, in the order of the guide's menu.

When not to

Pages that are not read in order, and long lists of pages (use list-pages).

Accessibility

A navigation landmark with two links marked as previous and next; each says which page it leads to.

See it live

The component library shows this component in the default theme, in every variant: open it in the component library

The previous and next example as the component library shows it in the default theme

Fields

What the component’s dialog asks for. In a Doc, keyed rows start with the key; rows in order follow the order below. Each row is a key and its value, in any order.

Field

Key

Kind

Required

Navigation root

root

A link: its text and address

No

Order

order

A value from a short list, or a setting

No

Items

items

A list of items

No

Variants

This component has no variants of its own; a theme can add some.

In Google Docs

A component is a table. Its first cell names it; the rows below hold its fields. This is the example table:

pager

In a page file

In a site kept as a folder or in Git, the same component is a block of the page’s JSON file:

JSON
{
  "name": "pager",
  "rows": []
}

Markup and classes

What the component writes takes these classes, for a theme’s CSS: the component’s own name, name__part for its parts and name--variant for each variant (the variant’s plain name is there too).

Class

What it marks

pager

The component

pager__label

A part of it

pager__link

A part of it

pager__link--next

A part of it

pager__link--previous

A part of it

pager__title

A part of it

The HTML the example above writes, as the component library builds it in the default theme:

html
<nav class="pager" aria-label="Pages of this guide">
  <a class="pager__link pager__link--previous" href="/components/note/" rel="prev"><span class="pager__label">Previous</span><span class="pager__title">note</span></a>
  <a class="pager__link pager__link--next" href="/components/products/" rel="next"><span class="pager__label">Next</span><span class="pager__title">products</span></a>
</nav>

Visitor texts

Texts it shows visitors, in the page’s language. Every one is in the visitor texts reference.

Key

Text

site.pager.label

Pages of this guide

site.pager.previous

Previous

site.pager.next

Next

Extending it

Its files in SeedPage. A theme or a site changes the markup by giving a file of the same name (the Liquid part), and a new component can extend this one.

  • src/components/pager.js
  • src/components/pager/pager.liquid