Home/Help/State machine/Start from a template

STATE MACHINE

Start from a template

The left panel's Start from has twelve ready flows: buttons, toggles, tabs, counters, loaders, a theme switcher. Here the switch already has its two states, Off and On; the Toggle template turns them into a flow that answers clicks, and My flows keeps it for your other projects.

Do it in the editor: guided tour4 steps · about 2 minutes · opens a practice scene

Step by step

  1. Open a template

    Under Start from › Click, click Toggle. Its card shows what it does, a small chart of it, and the states it uses: the ones your file already has by those names are marked yours, used as they are; the others would be added at the end of the timeline.

  2. Use it in this file

    Click Use in this file. The flow Toggle opens on the chart, with its interactions and its variable On, which the page can read and set. Nothing your project had is changed, and Undo takes it back in one step.

  3. Try it

    Click the switch on the canvas: it turns on, and the next click turns it off. The right panel's Variables shows On following it.

  4. Keep it in My flows

    Click + beside My flows, then Save “Toggle”. It is kept in this browser with its states, interactions, variables and actions (not the artwork or the keys), ready to use in any project. Its ⋯ menu downloads it as a file, to share it or use it on another computer.

Good to know. A template whose states the file doesn't have adds them after the animation, each its own length: animate them there, in Animate. Open the example on a card opens a small project where the template already works. My flows › + › Add from a file… brings in a flow someone shared.

Keys

EscClose the card