Separator

A visible divider between parts of a page.

When to use it

A visible break between two parts of a page that belong to different subjects.

When not to

Space between components, which themes already give, and separating sections that have headings.

Accessibility

A thematic break, said as a separator by screen readers.

See it live

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

Where it is used

The starter sites that use it, each at a page that shows it:

Fields

This component has no fields: it takes what it shows from the site.

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:

separator

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": "separator",
  "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

separator

The component

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

html
<hr class="separator">

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/separator.js
  • src/components/separator/separator.liquid