-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathlink-example.jsx
More file actions
40 lines (35 loc) · 1.07 KB
/
Copy pathlink-example.jsx
File metadata and controls
40 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from "react";
import { Link } from "live_react";
export function LinkExample({}) {
return (
<div className="space-y-4 p-4">
<h2 className="text-xl font-bold">Link Component Examples</h2>
<div className="space-y-2">
<p>
<Link href="/external" className="text-blue-600 hover:underline">
External Link (full page reload)
</Link>
</p>
<p>
<Link patch="/same-liveview" className="text-green-600 hover:underline">
Patch Link (same LiveView, calls handle_params)
</Link>
</p>
<p>
<Link navigate="/other-liveview" className="text-purple-600 hover:underline">
Navigate Link (different LiveView, same session)
</Link>
</p>
<p>
<Link
navigate="/replace-history"
replace={true}
className="text-red-600 hover:underline"
>
Replace History (navigate with replace)
</Link>
</p>
</div>
</div>
);
}