Skip to content

timeline

Dated steps in order.

Where it sits

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

A text holds it as a <block type="timeline" props="…"></block> element: its props are those below but type, which the element’s own type names.

See Bodies for how a body holds its blocks.

Props

Name Type Required Description
id string Yes The block’s id, unique within its body.
type "timeline" Yes The block’s type.
items array of object Yes Each step: its title, optional description and date, and either a state or its own color and shape, never both.
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": "timeline",
      "description": "The block's type."
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "success",
              "error",
              "warning",
              "unknown"
            ]
          },
          "color": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "emerald",
                  "amber",
                  "rose",
                  "sky",
                  "fuchsia"
                ]
              },
              {
                "type": "string",
                "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"
              }
            ]
          },
          "shape": {
            "type": "string",
            "enum": [
              "circle",
              "square",
              "heart",
              "star",
              "xmark",
              "check"
            ]
          }
        },
        "required": [
          "title"
        ],
        "not": {
          "required": [
            "state"
          ],
          "anyOf": [
            {
              "required": [
                "color"
              ]
            },
            {
              "required": [
                "shape"
              ]
            }
          ]
        },
        "additionalProperties": false
      },
      "description": "Each step: its `title`, optional `description` and `date`, and either a `state` or its own `color` and `shape`, never both."
    },
    "hidden": {
      "type": "boolean",
      "description": "Whether the block is hidden: it, and every block it holds, doesn't show."
    }
  },
  "required": [
    "id",
    "type",
    "items"
  ],
  "description": "Dated steps in order.",
  "additionalProperties": false
}

Type to search…

↑↓ navigate↵ selectEsc close