View Source Surface.Components.LivePatch (Surface v0.12.1)

This module is deprecated. Use Liveview's built-in `<.link>` instead.

Deprecation warning

This component has been deprecated in favor of liveview's built-in <.link> and will be removed in v0.13. See https://hexdocs.pm/phoenix_live_view/live-navigation.html for more info and usage.

Defines a link that will patch the current LiveView.

Provides similar capabilities to Phoenix's built-in live_patch/2 function.

When navigating to the current LiveView, handle_params/3 is immediately invoked to handle the change of params and URL state. Then the new state is pushed to the client, without reloading the whole page. For live redirects to another LiveView, use <LiveRedirect> instead.

Properties

  • to :string, required: true - The required path to link to

  • replace :boolean, default: false - The flag to replace the current history or push a new state

  • class :css_class, default: "" - The CSS class for the generated <a> element

  • label :string - The label for the generated <a> element, if no content (default slot) is provided.

  • opts :keyword, default: [] - Additional attributes to add onto the generated element

Slots

  • default - The content of the generated <a> element. If no content is provided, the value of property label is used instead.

Summary

Functions

render(assigns) deprecated

Callback implementation for Surface.Component.render/1.

Functions

This function is deprecated. Use liveview's built-in `<.link>` instead.

Callback implementation for Surface.Component.render/1.