Skip to content

Blocks

Every block a body holds, with its props and their JSON Schema.

Updated

A product’s, a lesson’s or an article’s, a custom page’s and the store’s home’s body is a layout of blocks, read as a JSON string in its content: through the customer API’s GET /v1/stores/{store}/body or include=body, and written through the merchant API. These pages are built from the same definition the API checks a body against, so they list every type and prop it takes.

The whole block schema, every type in one, is at https://docs.sherpo.io/overview/blocks/schema.json (JSON Schema draft 2020-12): each type’s page names it for the blocks a block holds.

Bodies

  • A body is an object whose blocks is its list of blocks, in the order they show. The store’s home’s, a custom page’s and a product’s may also hold a hero block under their own hero key, shown first.
  • A product’s page opens with its columns: aside blocks, each holding the blocks of the main or the side column, followed by any other blocks.
  • Every block has an id, unique within its body, its type, and optionally hidden: true, which hides it and every block it holds.
  • A text (a markdown block’s content, and the rich texts other blocks hold) may hold blocks too, as <block type="…" props="…"></block> elements whose props are a block’s but its type, read back with their defaults filled in. See Bodies and rich text.
  • A block naming a store file holds its id (fileId); the read lists the file under files. See Files and media.
  • Render a type you don’t know as nothing: a body saved long ago may hold a type this reference doesn’t list, and new types may be added.

Types

Where each type sits: Yes in the body itself, In a text only inside the body’s texts.

Type What it is The store’s home A custom page A product’s page A portfolio’s page A lesson An article
actions A row of link buttons. Yes Yes Yes Yes Yes Yes
article-list A blog’s articles, newest first. On a blog’s page only. No No Yes Yes No No
article-search A blog’s search and filters. On a blog’s page only. No No Yes Yes No No
aside A column of a product’s page: the main one, or the side one. No No Yes Yes No No
audio An audio file played with its waveform: a store file, or an external URL. Yes Yes Yes Yes Yes Yes
background-image An image the page’s background takes while the blocks after it show. Yes Yes Yes Yes No Yes
card A card holding blocks. Yes Yes Yes Yes Yes Yes
carousel A row of slides, one block each, scrolled sideways. Yes Yes Yes Yes Yes Yes
contact Ways to reach the store. Yes Yes Yes Yes Yes Yes
download A store file to download: a card, or with inline a link inside a sentence. Yes Yes Yes Yes Yes Yes
expandable Blocks shown up to a set height, with a button to show the rest. Yes Yes Yes Yes Yes Yes
faq Questions and their answers. Yes Yes Yes Yes Yes Yes
formula A display formula, rendered as math. Yes Yes Yes Yes Yes Yes
grid Blocks laid out in columns. Yes Yes Yes Yes Yes Yes
grid-products The store’s products, as cards in a grid. Yes Yes Yes Yes No Yes
hero The heading section that opens a page. Yes Yes Yes Yes No Yes
hr A horizontal rule. Yes Yes Yes Yes Yes Yes
image An image: a store file, or an external URL. Yes Yes Yes Yes Yes Yes
line-products The store’s support products (tips, donations, calls), in a row. Yes Yes Yes Yes No Yes
logo-cloud A row of logos. Yes Yes Yes Yes Yes Yes
markdown A rich text. Yes Yes Yes Yes Yes Yes
portfolio-activity A portfolio’s trades and events. On a portfolio’s page only. No No Yes Yes No No
portfolio-chart A portfolio’s performance chart. On a portfolio’s page only. No No Yes Yes No No
portfolio-holdings A portfolio’s holdings. On a portfolio’s page only. No No Yes Yes No No
portfolio-stats A portfolio’s headline figures. On a portfolio’s page only. No No Yes Yes No No
portfolio-watchlist A portfolio’s watchlist. On a portfolio’s page only. No No Yes Yes No No
portfolio-weights A portfolio’s holdings by weight. On a portfolio’s page only. No No Yes Yes No No
pricing Plans side by side, with their prices and features. Yes Yes Yes Yes Yes Yes
product-card One of the store’s products, as a card. Yes Yes Yes Yes No Yes
product-content A product page’s list of the files it gives. No No Yes Yes No No
product-description A product’s description text. No No Yes Yes No No
product-get A product page’s buying section: its prices and the button to get it. No No Yes Yes No No
product-pages A product page’s list of its lessons or articles. No No Yes Yes No No
product-review A product’s reviews: their count and average rating. No No Yes Yes No No
product-summary What a product holds, counted: its lessons, videos, files and the like. No No Yes Yes No No
product-what-you-get What a product gives, its what_you_get text. No No Yes Yes No No
products The store’s products, as cards in a grid. An older form of grid-products. Yes Yes Yes Yes No Yes
side-by-side Two columns of blocks side by side. Yes Yes Yes Yes Yes Yes
slideshow A PDF from the store’s files shown a page at a time, as a lesson’s slides are, with no download. Yes Yes Yes Yes Yes Yes
spacer Empty space between blocks. Yes Yes Yes Yes Yes Yes
stats Figures with their labels. Yes Yes Yes Yes Yes Yes
theme-aware Blocks shown in light mode, and others in dark mode. Yes Yes Yes Yes Yes Yes
timeline Dated steps in order. Yes Yes Yes Yes Yes Yes
titled-section A section of blocks under a heading. Yes Yes Yes Yes Yes Yes
video A video: a store file, or an external URL. Yes Yes Yes Yes Yes Yes
youtube A YouTube video. Yes Yes Yes Yes Yes Yes

Type to search…

↑↓ navigate↵ selectEsc close