Vector State Machine
A tiny, zero-dependency state machine for SVG. Author in your vector tool, scrub the timeline, drop markers β states, wire triggers, and export a drop-in package. No WASM, no runtime renderer β just clean SVG in the DOM.
π click the button β the path morphs and the colour shifts, driven by the state machine
tip In the editor, hit Load sample to scrub this exact button, then βΆ test and Export.
Design & animate in Expressive Animator β keep the .eaf file.
Connect states β click, hoverβ¦ β emit events back to your app. Test live on the stage.
~2 KB core. Drop it on any page; it drives the SVG you already have.
default β A β default β B, with triggers, conditions, and emitted events back to your app.
Vanilla JS, Vue, React β same core. Local-cache persistence built in.
Import an Expressive Animator .eaf, scrub, mark states, export SVG + .vsm.json.
<!-- the editor exports a self-contained button.js (16 KB, 0 deps) --> <div id="btn"></div> <script type="module"> import mount from './button.js'; const m = mount('#btn', { persist: { key: 'btn' } }); m.on('onPress', () => addToCart()); btn.onclick = () => m.fire('press'); </script>