Skip to content

UX Prototyping & Protopie

  • Principles
    • Educational
    • Figma Integration
  • Patterns, Pitfalls, Ploys
    • Patterns
    • Pitfalls
    • Ploys
  • More …
    • People-Centered Design
    • Thinking about AI
  • Principles
    • Educational
    • Figma Integration
  • Patterns, Pitfalls, Ploys
    • Patterns
    • Pitfalls
    • Ploys
  • More …
    • People-Centered Design
    • Thinking about AI

Use Variables

Variables can sometimes feel a little clumsy, but they can make a big difference to simplifying your code. This is especially true if you also use “Detect” triggers and maybe even formula values for your variables.

For example, if you have a password input field you can have a variable that uses a ‘length’ formula to always have the value of the number of characters in the password. Using a detect on this variable enables you to trigger action when the password is 8 or more characters.

Achieving the same effect without a variable is tricky, but there are other good reasons to use variables – you can track their value in Preview mode and this can help you fix errors in your logic. If you rely just on properties of objects, tracking their value can be harder.

The contrasting position is that some classic variables are really not needed – for example, ‘status’ variables for toggling states can sometimes be avoided by simply inspecting the opacity of the relevant object. However, one advantage of using a 0 or 1 status variable is that the opacity of your on indicator can be set to a formula (status*100) which means you only need change the status variable and the change will be shown automatically.

Using a variable can also simplify the construction of conditionals. For example, this Pie (based on one by Alisa) uses a variable called match which reflects whether each password field is more than 5 characters and matches the other field. Using these means that one has one set of simple conditions for giving match a value and another set of simple conditions for responding once there is match (using a Detect trigger).

Inspecting this variable match makes it easy to see when the passwords match and when they don’t. The condition for highlighting the Create Account button simply checks the checkbox whenever the match is 1.

Origami Studio, Figma and others

How do these other popular platforms compare?

Receive and Assign hazard

Receiving a message, and then assigning a value and then writing a conditional based on that value is that something that is quite a normal, conceptual pattern – but in Protopie it will often not work as expected. This is because responses to Protopie triggers all happen simultaneously and not in the order written.

Use Components

It will often seem as though it will be faster to use individual elements than to use components, but in the end the time saving almost always goes the other way.

Put code inside components

Protopie code can get complex and hard to follow surprisingly quickly. Putting as much code as possible within your components can keep your main scenes simpler and cleaner.

Rough, Rapid, Right

Keep trigger and response names visible

It is very important to annotate your code with what it is actually doing, but keeping the trigger and response names helps someone new to the project (or you in three month's time.

Arrays and multiple parameters

Protopie seems limited since a message can be sent using only one value as a parameter. However, arrays (written as text strings and manipulated by parseJson) can be used for contexts where multiple parameters need to be passed.

Good Prototyping Practice

IDEO's 3R prototyping principles from the late 1990s still apply - "Right, Rough, Rapid" but in the UX and UI space they are easily misunderstood.

Use Components

Using the wrong mental model for Protopie

Use overridable variables in components

Check if Protopie Connect is present

Arrays and multiple parameters

How to inspect variables inside a component

  • Welcome
  • What’s New?
  • About
  • Welcome
  • What’s New?
  • About

info@peoplecentereddesign.org

© 2026 David Gilmore