Skip to main content

Top-level connections

Blocks have three connections whose use is optional.

Statement Connections​

Users can create sequences of blocks using the nextStatement and previousStatement connectors. In Blockly's standard layout, these connections are on the top and the bottom, with the blocks stacked vertically.

A block with a previous connector cannot have an output connector. The term statement block refers to a block with no output connector. A statement block will usually have both a previous connection and a next connection.

nextStatement and previousStatement connections can be typed, but this feature is not utilized by standard blocks.

Next Connection​

Creates a point at the bottom of the block, so that other statements can be stacked below it. A block with a next connection but no previous connection usually represents an event, and can be configured to render with a hat.

A block with no fields and a tab on the
bottom.

Untyped:

{
...,
"nextStatement": null,
}

Typed (rare):

{
"nextStatement": "Action",
...
}

Previous Connection​

Creates a notch at the top of the block, so that it can be connected as a stack of statements.

Blocks with a previous connection cannot have an output connection.

A block with no fields and a notch on the
top.

Untyped:

{
...,
"previousStatement": null,
}

Typed (rare):

{
"previousStatement": "Action",
...
}

Output connection​

A block may have a single output connection, represented as a male jigsaw connector on the leading edge. Outputs connect to value inputs. Blocks with an output are usually called value blocks.

A block with no fields and a male puzzle connector on the left
edge.

Untyped:

{
// ...,
"output": null,
}

Typed:

{
// ...,
"output": "Number",
}

Blocks with an output connector cannot also have a previous statement notch.