toggle.lucy state enabled { toggle => disabled } initial state disabled { toggle => enabled } out.js import { createMachine } from 'xstate'; export default function() { return createMachine({ initial: 'disabled', states: { enabled: { on: { toggle: 'disabled' } }, disabled: { on: { toggle: 'enabled' } } } }); } Install See the install page for detailed instructions on the various ways you can use L