Links
Easily create links, live patches or live redirects.
Types
<.link to="/" class="" label="Link" />
<.link link_type="live_patch" to="/" class="" label="Link" />
<.link link_type="live_redirect" to="/" class="" label="Link" />
<!-- We use Phoenix.HTML.Link.link() -->
<.link to="/" method class="" label="Link" />
Under the hood we use the functions:
- Phoenix.HTML.Link.link/2
- Phoenix.LiveView.Helpers.live_patch/2
- Phoenix.LiveView.Helpers.live_redirect/2
All props are forwarded to these functions so you can do something like this:
<.link to="/logout" method={:delete} class="" label="Logout" />
Properties
Defaults are indicated in bold.
Name | Type | Options |
---|---|---|
label | :string | - |
class | :string | - |
link_type | :string |
a
, `live_patch`, `live_redirect`, `button`
|
inner_block | :slot | - |
[all additional properties] |
Will be forwarded to all
link HTML elements.
|