<%= render( ButtonComponent.new( actions: on(:click).call(:my_click_handler) ) ) %>
<%= render( ButtonComponent.new( actions: on(:click).call(:my_click_handler) ) ) %>
<%= render(ButtonComponent.new(targets: target(:submit_button))) %>
<%= render(ButtonComponent.new(targets: target(:submit_button))) %>
<%= content_tag(actions: on(:click).call(:my_method)) %>
<%= content_tag(actions: on(:click).call(:my_method)) %>
Note that the on and target methods are only available on components that inherit from (i.e. include) the LiveComponent::Base module.