Type System

> Every pin has a type. Matching types keep your flows correct.

Brickr uses a strict type system to ensure that data flowing between nodes is compatible. Each pin on a node has a defined type, and you can only connect pins of matching or explicitly compatible types. This prevents runtime errors and makes your flows easier to read at a glance.

Why types matter

Without types, you could accidentally connect a number output to a node expecting text, or pass a single value where an array is required. The type system prevents these mistakes by:

  • Restricting connections -- You can only draw a wire between compatible pins
  • Color-coding wires -- Each type has a distinct color so you can visually trace data flow
  • Validating at build time -- Errors are caught in the editor, not at runtime

Pin colors

These are the wire colors used in the Builder:

| Type | Wire color | Hex | |------|------------|-----| | String | Teal | #4ecdc4 | | Number | Coral / red | #ff6b6b | | Boolean | Amber | #f59e0b | | Object | Indigo | #6366f1 | | Enum | Purple | #a855f7 | | File | Cyan | #22d3ee | | Web Element | Emerald | #10b981 | | Style | Pink | #ec4899 | | Any | Gray | #888888 | | Sequence | White | #ffffff |

Use this page as the source of truth for pin colors. Other docs should link here instead of repeating the palette.

Type categories

Brickr's types fall into several categories:

Primitives

The basic building blocks: string, number, and boolean. These represent simple, single values.

Objects

Structured data with named properties. Objects can be generic or conform to a specific structure (e.g., object:file).

Arrays

Lists of values. Any type can become an array: string:array, number:array, object:file:array. Generic arrays stay neutral in the editor; typed arrays inherit the element type color.

Enums

Named sets of allowed values. Enums restrict a pin to a predefined list of options.

Special types

  • any -- Accepts any data type. Use sparingly.
  • sequence -- Controls execution order, not data flow. The white triangle connections.

Type compatibility

When you drag a wire from an output pin, the Builder highlights only the compatible input pins you can connect to. The rules are:

  • Exact match -- string connects to string
  • Any accepts all -- An any input accepts any type
  • Array matching -- string:array connects to string:array, not to string
  • Object structures -- object:file connects to object:file or to a generic object input

What's next?

| Topic | Description | |-------|-------------| | Primitives | String, number, boolean | | Objects | Structures and the object type | | Arrays | Working with lists | | Enums | Named value sets |