e.color_idx + 1) % COLORS.length
      return {color_idx: new_idx}
    end
  end

  class MainComponent &lt; Ovto::Component
    def render
      o 'input', {
        type: 'button',
        value: 'Hello',
        style: {background: COLORS[state.color_idx]},
        onclick: -&gt;{ actions.update_color },
      }
    end
  end
end

MyApp.run(id: 'ovto')
</code></pre>
<p>Here we added <code>color_idx</code> to app state and <code>update_color</code> action to change it.
The button is updated to have the co