View Source SaladUI.LiveView (SaladUI v1.0.0-beta.1)

Helper functions for integrating SaladUI with Phoenix LiveView.

Summary

Functions

Send a command to a SaladUI component. This is useful for programmatically controlling components from server-side code.

Functions

Link to this function

send_command(socket, component_id, command, params \\ %{})

View Source

Send a command to a SaladUI component. This is useful for programmatically controlling components from server-side code.

Parameters

  • socket: The LiveView socket.
  • component_id: The ID of the component to send the command to.
  • command: The name of the command to send. Command could be any transitions that component state machine support or custom commands that supported by component.
  • params: Optional parameters for the command.

Example

send_command(socket, "dialog", "open")