Link
NewOverview
Use a link whenever you navigate to a new page or patch the current LiveView.
<div class="flex flex-wrap items-center gap-4">
<Link.link navigate={~p"/docs/installation"}>Installation</Link.link>
<Link.link
color={:blue}
href="https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#link/1"
>Phoenix link documentation</Link.link>
<Link.link
color={:muted}
patch={@tab_path <> "?tab=activity"}
>Patch this page</Link.link>
</div>
Add this module
mix dizzy.add link
Component API
Link.link
Attributes
| Name | Type | Default | Values |
|---|---|---|---|
class |
:any
| nil | โ |
color |
:atom
| :current | :current, :blue, :muted |
href |
:any
| nil | โ |
method |
:atom
| :get | :get, :head, :post, :put, :patch, :delete, :options, :connect, :trace |
navigate |
:string
| nil | โ |
patch |
:string
| nil | โ |
replace |
:boolean
| false | โ |
rest |
:global
| nil | โ |
Slots
| Name | Required | Attributes |
|---|---|---|
inner_block | Required | โ |
Link.link_button
Attributes
| Name | Type | Default | Values |
|---|---|---|---|
class |
:any
| nil | โ |
href |
:any
| nil | โ |
method |
:atom
| :get | :get, :head, :post, :put, :patch, :delete, :options, :connect, :trace |
navigate |
:string
| nil | โ |
patch |
:string
| nil | โ |
replace |
:boolean
| false | โ |
rest |
:global
| nil | โ |
Slots
| Name | Required | Attributes |
|---|---|---|
inner_block | Required | โ |