View Source Button

<Button>

<Button>, sends events when tapped.

Overview

Use the phx-click attribute to specify which event to fire on tap.

<Button phx-click="my_event" phx-value-extra="more info">Click Me!</Button>
def handle_event("my_event", %{ "extra" => extra }, socket) do
    {:noreply, assign(socket, value: extra)}
end

Attributes

Events

SwiftUI Documentation

See SwiftUI.Button for more details on this View.

References

Event triggered when tapped.

The semantic role of the button.

Discussion

Possible values:

  • destructive
  • cancel