Home/State machine

STATE MACHINE & THEMES

Make it react.
In one file.

Name the moments of your timeline as states, then draw how the animation moves between them: on a hover, a click, a message from the page, or when a value says so. Give the file themes. Export one animated SVG with its player inside, or a .lottie that plays in apps.

The State machine workspace: the canvas plays the flow as your visitors will see it. Click the heart; the chart below shows where it is, and the panel on the right what happened.
STATES

Name the moments on your timeline.

A state is a stretch of the one timeline: Idle, Hover, Pressed. Draw it across the States lane, or make it from the keys you selected. A state of no length is a pose, one frame held.

A window on the timeline

Move a state and the keys stay where they are; hold Alt to carry them along.

Past its neighbours

Drag one past the others to any free time. Where the gap is too short, it asks: make room, or shrink to fit.

Play just one

Play this state, focus the timeline on it, give it a color, and trim layers to their own part of it.

FLOWS

Draw how it moves between them.

A flow is a chart: the states it uses, and arrows that say when it goes from one to the next. Each state plays once, loops, or holds; an arrow can blend from wherever the drawing is.

Pointer

Hover, leave, click, press and release, anywhere or on one layer.

Time

At the end of a state, after a while, or as soon as a condition holds.

The page

A message from your site’s code moves the flow, whatever it is doing.

Any state

Interactions that apply whatever plays: a click that always counts, a message that always resets.

Overlaps found for you

Two interactions answering the same click are flagged, with which one runs.

Several flows

Keep variants in one file; one starts, and the page can switch to another.

VARIABLES & ACTIONS

Remember, decide, act.

A flow can count clicks, remember a choice and react to what the page tells it. Test everything on the canvas before you export: it plays the flow, and What happened lists every step.

  • Variables: numbers, on / off and text; the page can read and set them
  • Conditions: a click that counts only while unlocked; go on once Likes reach 5
  • Actions: set or add to a variable, switch the theme, open a link, tell the page, when a state starts or ends
TEMPLATES

Twelve flows to start from.

A template adds its flow and the states it needs; states you already have are used by name, never changed. Open its example to see it working, and save your own flows to use in any project.

Pointer

Hover and press, in place or on one layer.

Button: hover & pressHover revealTabs

Click

Toggle, count, step through.

ToggleLike counterSteps / carouselExpand / collapse

Playback

How it plays on its own.

Intro, then loopLoading → done

The page

Driven by your site’s code.

Submit buttonNotification

Look

Themes, switched by a click.

Theme cycler

My flows

Your own, kept in this browser, and shared as a file.

+ Save the open flowAdd from a file…
THEMES & TOKENS

One file, every look.

A token is a named value linked to the properties that use it: a color, a number, a text block or a picture. A theme gives each token its own value. Light and dark, a brand variant, a seasonal one: all in the same file.

  • Switch themes on the canvas; edits go to the theme that shows (Auto token)
  • A flow switches them too: to a theme, or to the next one on every click
  • Set by the page: a token your site fills in, like its own brand color or a name
EXPORT

Interactive, in one file.

Both play the flow on their own: no code to write. When your page wants to join in, the embed code shows what it can call.

Animated SVG

The flow runs in the player inside the file, with its themes and tokens. Test it in the Export window’s preview, exactly as it will play.

// the page, talking to the flow
player.send("reset");            // a message
player.set("Likes", 3);          // a variable
player.theme("Dark");            // a theme
player.flowState();              // "Liked"

svg.addEventListener("cin:state", e => …);

.lottie

The flows become dotLottie state machines, the themes and tokens its themes and slots, for the dotLottie players on the web, iOS, Android, Flutter and React Native. The preview plays it in the official player.

new DotLottie({
  canvas, src: "like.lottie",
  stateMachineId: "Like counter",
  themeId: "Dark",
});

Start from a template.

Open the editor, switch to State machine at the top, and pick one under Start from.