Skip to content

hero

The heading section that opens a page.

Where it sits

Body In the body Inside its texts
The store’s home Yes No
A custom page Yes No
A product’s page Yes No
An event’s page Yes No
A portfolio’s page Yes No
A lesson No No
An article Yes No

See Bodies for how a body holds its blocks.

It holds other blocks: each nested block is one of the types this reference lists that its body takes, as the whole block schema reads it.

Props

Name Type Required Description
id string Yes The block’s id, unique within its body.
type "hero" Yes The block’s type.
eyebrow string No A short line over the title.
title string No The title; a product page’s hero shows the product’s own when it is empty.
subtitle string No A line under the title.
description string No A paragraph under the title.
alignment "start" or "center" or "end" No How its content aligns: start, center or end.
primaryAction object No A link button: its label, href and variant, and whether it shows an arrow.
secondaryAction object No A link button: its label, href and variant, and whether it shows an arrow.
highlights array of string No Short points listed under the description.
additionalContent block or array of block No Blocks shown with the heading: beside it on wide screens unless it is centered, under it otherwise.
lineProducts object No A line-products block it shows under its content, the store’s support products. Defaults to {"id":"default-line","hidden":false,"type":"line-products"}.
hidden boolean No Whether the block is hidden: it, and every block it holds, doesn’t show.

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The block's id, unique within its body."
    },
    "type": {
      "type": "string",
      "const": "hero",
      "description": "The block's type."
    },
    "eyebrow": {
      "type": "string",
      "description": "A short line over the title."
    },
    "title": {
      "type": "string",
      "description": "The title; a product page's hero shows the product's own when it is empty."
    },
    "subtitle": {
      "type": "string",
      "description": "A line under the title."
    },
    "description": {
      "type": "string",
      "description": "A paragraph under the title."
    },
    "alignment": {
      "type": "string",
      "enum": [
        "start",
        "center",
        "end"
      ],
      "description": "How its content aligns: `start`, `center` or `end`."
    },
    "primaryAction": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "href": {
          "type": "string"
        },
        "variant": {
          "type": "string",
          "enum": [
            "primary",
            "secondary",
            "ghost"
          ]
        },
        "showArrow": {
          "type": "boolean"
        }
      },
      "required": [
        "label",
        "href"
      ],
      "description": "A link button: its `label`, `href` and `variant`, and whether it shows an arrow.",
      "additionalProperties": false
    },
    "secondaryAction": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "href": {
          "type": "string"
        },
        "variant": {
          "type": "string",
          "enum": [
            "primary",
            "secondary",
            "ghost"
          ]
        },
        "showArrow": {
          "type": "boolean"
        }
      },
      "required": [
        "label",
        "href"
      ],
      "description": "A link button: its `label`, `href` and `variant`, and whether it shows an arrow.",
      "additionalProperties": false
    },
    "highlights": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Short points listed under the description."
    },
    "additionalContent": {
      "anyOf": [
        {
          "$ref": "https://docs.sherpo.io/overview/blocks/schema.json"
        },
        {
          "type": "array",
          "items": {
            "$ref": "https://docs.sherpo.io/overview/blocks/schema.json"
          }
        }
      ],
      "description": "Blocks shown with the heading: beside it on wide screens unless it is centered, under it otherwise."
    },
    "lineProducts": {
      "default": {
        "id": "default-line",
        "hidden": false,
        "type": "line-products"
      },
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "line-products"
        },
        "hidden": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "type"
      ],
      "description": "A `line-products` block it shows under its content, the store's support products.",
      "additionalProperties": false
    },
    "hidden": {
      "type": "boolean",
      "description": "Whether the block is hidden: it, and every block it holds, doesn't show."
    }
  },
  "required": [
    "id",
    "type"
  ],
  "description": "The heading section that opens a page.",
  "additionalProperties": false
}

Type to search…

↑↓ navigate↵ selectEsc close