Profile

A person: photo, name, roles and links.

When to use it

One person with photo, name, roles and links: the author of a page, the owner of a business. Kept in a fragment, it can be reused on many pages.

When not to

Groups of people (use profiles) and quotes from clients (use quote).

Accessibility

The photo is described by the person's name; links say where they go.

See it live

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

The profile 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. Each row is a key and its value, in any order.

Field

Key

Kind

Required

Photo

photo

An image from the assets, with its description

No

Name

name

Plain text, one line

Yes

Roles

roles

Plain text, one line

No

Link

link

A link: its text and address

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:

profile

photo

[Image]

name

Ana Ruiz

roles

Mountain guide

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": "profile",
  "rows": [
    [
      "photo",
      {
        "image": "Portrait of Ana"
      }
    ],
    [
      "name",
      "Ana Ruiz"
    ],
    [
      "roles",
      "Mountain guide"
    ]
  ]
}

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

profile

The component

profile__image

A part of it

profile__initials

A part of it

profile__link

A part of it

profile__links

A part of it

profile__name

A part of it

profile__photo

A part of it

profile__roles

A part of it

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

html
<div class="profile">
<div class="profile__photo"><img class="profile__image" src="/assets/img/5521e01d770e-1600.webp" srcset="/assets/img/5521e01d770e-400.webp 400w, /assets/img/5521e01d770e-800.webp 800w, /assets/img/5521e01d770e-1600.webp 1600w" sizes="(max-width: 800px) 100vw, 800px" alt="Ana Ruiz" width="1800" height="900" fetchpriority="high" decoding="async"></div>
<h3 class="profile__name">Ana Ruiz</h3>
<p class="profile__roles">Mountain guide</p>
</div>

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/profile.js
  • src/components/profile/links.liquid
  • src/components/profile/name.liquid
  • src/components/profile/photo.liquid
  • src/components/profile/profile.liquid
  • src/components/profile/roles.liquid