GCBGutenberg
Control Blocks
Buy

Field type

path

A line a person shapes, with stops along it and a box of content set off from each stop: a road with places on it, a journey, a curved timeline. One value places the line, the dots and the boxes in the editor and on the page.

Type: path · Stored attribute type: object

Stored value

object — { points: [[x, y], …], stops: [{ at, box?: [dx, dy, w], side?: left|right|above|below, ride?: true, always?: true }], tall?: number }; every number a share of the stage (0 its left or top, 1 its right or foot), at a share of the line's length

Supports

  • A line by shape — across, arc, wave (held on the screen, 16 by 9) or down, zigzag (running down the page), or by its own points; it is drawn as one smooth curve through them.
  • Stops — each a dot on the line at at; with a side its box stands that side of the dot, held by the edge that faces it, so the box stays clear of the line however tall its content grows.
  • tall (1 to 8) — the stage runs down the page that many screens tall, instead of being held on the screen.
  • more (a path with tall only) — a TRAIN SET. The line's points are its nodes; a node and the line to the next is a piece of track; a stop's box is an accessory beside its piece. What is drawn is the pattern, and more is how many nodes have been added after it: each lays one more piece, shaped as the pattern's next piece in turn (the last drawn node plays the first node's part, so the next stands off it as the second stood off the first), with that piece's boxes. An editor presses Add node and fills the new boxes; nobody redraws the line. Written short: line zigzag; tall 2; more 3; stop 0.3 right; stop 0.7 left.
  • always: true — the stop is on the page from the start, not only once the line has reached it: a title, a legend, where the journey starts. Written short: stop 0.1 above always.
  • ride: true — the box waits at its dot, then travels with the tip of the line. There is one of it for the whole line: nodes added with more do not repeat it. It is where a Path rider block goes (the Path block's guide).
  • A short written form, shown in the field and accepted there: line wave; stop 0.2 above; stop 0.5 below; stop 0.8 above · line down; tall 3; stop 0.3 right; stop 0.7 left 0.2 ride · line 0.1,0.5 0.5,0.8 0.9,0.5; stop 0.5 box -0.1,-0.4 0.2.
  • Checked as written — the field says what is wrong as sentences, and a value with anything wrong in it is not drawn.

Gotchas

  • The boxes are the block's children in the stops' order: the first child fills the first stop that has a box. Keep as many children as there are boxed stops.
  • On a phone the boxes are a list, one under another; the line is for screens wide enough to draw it.
  • In render.php place them with \GCBLite\Contract\PathValue::css( $value, $dotSelector, $boxSelector ) and draw the line with PathValue::d( $points ); do not work the curve out again.

Example

JSON
{ "id": "ctrl_path",
  "type": "path",
  "label": "Path",
  "attributeKey": "path",
  "start": { "points": [[-0.05, 0.5], [0.25, 0.32], [0.5, 0.5], [0.75, 0.68], [1.05, 0.5]], "stops": [] } }

The path field

For a person the field is a canvas: a popout where a click adds a node (a square on the line) or a box (the switch at the top says which), a node is pulled to move it, and each box is dragged round its place on the line (it clicks to a side). Adding a box adds a Box to the block, and removing it takes that Box away. The written short form is for a model; a person finds it folded away under the canvas. gcb/path (the Path block) is the block that uses it.

Every field also takes the keys common to all fields.

Built from GCB Lite 0.4.0 (ce232d4). Source: schemas/controls/path.md.

Copyright © 2026 Runchain. WordPress is a trademark of the WordPress Foundation.