Note

A short aside the reader should not miss: a note, a tip or a warning.

When to use it

A short aside the reader should not miss: a tip, a warning before a step that cannot be undone, a requirement.

When not to

Whole paragraphs of normal text, and more than one or two per screen: they stop standing out.

Accessibility

Marked as a note for screen readers; its kind is said by its title and not only by its colour, so write a title such as "Warning".

See it live

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

The note 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

Title

title

Plain text, one line

No

Text

text

Text with headings, lists, links and bold

Yes

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

Tip

note (tip)

Warning

note (warning)

In Google Docs

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

note

title

Before you start

text

Keep a copy of the site folder.

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": "note",
  "variants": [
    "tip"
  ],
  "rows": [
    [
      "title",
      "Before you start"
    ],
    [
      "text",
      "Keep a copy of the site folder."
    ]
  ]
}

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

note

The component

note__text

A part of it

note__title

A part of it

note--tip

A variant

note--warning

A variant

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

html
<div class="note" role="note">
  <p class="note__title">Before you start</p>
  <div class="note__text"><p>Keep a copy of the site folder.</p></div>
</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/note.js
  • src/components/note/note.liquid