Logo

The site's logo, leading to the home page; it shows the logo of the site settings

When to use it

The site's logo in the header, leading to the home page. It shows the logo of the site settings, so it changes everywhere at once.

When not to

Other images in the content (use image).

Accessibility

A link named by the site's name, with the logo's description; the with-name variant also writes the name next to the logo.

See it live

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

The logo example as the component library shows it in the default theme

Where it is used

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

Fields

What the component’s dialog asks for. In a Doc, keyed rows start with the key; rows in order follow the order below. One row, its cells in the order of the fields.

Field

Key

Kind

Required

Logo

logo

An image from the assets, with its description

No

Variants

A variant changes how the component looks. Write it in parentheses after the name in the table’s first cell, several separated by commas.

Variant

Write in the first cell

Name beside the logo

site-logo (with-name)

In Google Docs

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

site-logo

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": "site-logo",
  "variants": [
    "with-name"
  ],
  "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

site-logo

The component

site-logo__name

A part of it

site-logo--with-name

A variant

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

html
<a class="site-logo" href="/">Component library</a>

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