Types of Variables

This documentation is about setting variables on the current tab/frame.

If you need to store data that are accessible to multiple team members, or across page loads, see PixieBrix’s Team Databases feature

Mod Variables are variables that are shared across starter bricks in a mod, and available across runs of the mod during a page session. Reloading a page or navigating to a different page clears the Mod Variables for the tab.

Example situations of when to use Mod Variables are:

  • Keep track of whether a mod has already run on a page

  • Making information available on a Sidebar

  • Pass information between frames or tabs (Advanced)

Advanced: Page State is in-memory storage that persists during a page session. There are 3 Page State namespaces to isolate information:

  • Private — accessible only for bricks attached to the starter brick

  • Mod — accessible to all bricks in the mod

  • Public — accessible to all bricks

PixieBrix stores Mod Variables in the Mod Page State.

Deciding which variable to use

Variable Type
Variable Name
When/How They're Set
Availalbility

Mod Variable

@mod

Assign Mod Variable brick

Set Shared Page State brick (Advanced)

Available to all non-starter bricks in the mod

Starter Brick Variable

@input

When the Starter Brick Runs

Available to all bricks after the starter brick

Mod Option Variable

@options

When Activating a Mod When Deploying a Mod

Available to all bricks in a mod

Local Variable

Varies - set via the Output field for a brick

Output from a Brick

Available to all bricks after the brick at the same, or deeper nested level

Last updated