Surface.Components.Link (surface v0.2.0) View Source

Defines a hyperlink.

Provides a wrapper for Phoenix.HTML.Link's link/2 function.

All options passed via opts will be sent to link/2, label and class can be set directly and will override anything in opts.

Examples

<Link
  label="user"
  to="/users/1"
  class="is-danger"
  opts={{ method: :delete, data: [confirm: "Really?"] }}
/>

<Link
  to="/users/1"
  class="is-link"
>
  <span>user</span>
</Link>

Properties

  • to :string, required: true - Place to link to.
  • class :css_class - Class or classes to apply to the link.
  • opts :keyword, default: [] - Keyword with options to be passed down to link/2.
  • label :string - The label for the generated <a> alement, if no content (default slot) is provided. .
  • click :event - Triggered on click.

Link to this section Summary

Link to this section Functions

Callback implementation for Phoenix.LiveComponent.mount/1.

Callback implementation for Phoenix.LiveComponent.render/1.

Callback implementation for Phoenix.LiveComponent.update/2.