Events

Overview of block and slide events in Pathway.

Events describe when actions run. They are attached to blocks (like HTML events such as click or hover) or to slides (like on slide start/end).

Block events

Blocks can define event handlers like click (and later hover, focus, etc.). Each event can run one or more actions, with optional conditions and optional params.

Example (JSON):

{
  "id": "link-btn",
  "kind": "button",
  "text": "Open Google",
  "click": [
    {
      "action": "core.link",
      "conditions": [
        {
          "variable": "score",
          "comparison": "greater_than",
          "value": 0
        }
      ],
      "params": {
        "href": "https://www.google.com"
      }
    }
  ]
}
  • conditions are optional.
  • params are optional and depend on the action (some actions accept no params).

Slide events

Slides can also define events such as onSlideStart (and later onSlideEnd). These run actions automatically when the slide lifecycle event occurs.

  • See Actions for how actions are defined and which built-in actions exist.