Link
NewOverview
Use a link whenever you navigate to a new page or patch the current LiveView.
<div class="flex flex-wrap items-center justify-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 |
:string
| "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 |
|---|---|
inner_block | Required |
Link.link_button
Attributes
| Name | Type | Default | Values |
|---|---|---|---|
class |
:any
| nil | โ |
href |
:any
| nil | โ |
kind |
:atom
| :primary | :primary, :secondary, :outline, :ghost, :destructive |
method |
:string
| "get" | "get", "head", "post", "put", "patch", "delete", "options", "connect", "trace" |
navigate |
:string
| nil | โ |
patch |
:string
| nil | โ |
replace |
:boolean
| false | โ |
rest |
:global
| nil | โ |
size |
:atom
| :lg | :xs, :sm, :md, :lg, :icon_xs, :icon_sm, :icon, :icon_lg |
Slots
| Name | Required |
|---|---|
inner_block | Required |