x
1
2
3
4
<div class='lui-link'><a href="https://www.google.pt" data-turbo-target="lui-main-layout" data-turbo-action="navigate" target="_blank"> https://www.google.pt</a></div>Link
Description
Related components
| Used Components | Components where is Used |
|---|---|
| Label |
Usage rules
- ✅ Do
- ❌ Don't
1
<%= render LooposUi::Link.new(url: params["url"] || "https://www.google.pt", text: params["text"], turbo_target: params["turbo_target"], turbo_action: params["turbo_action"], class: "foo", target: "_blank")%>No notes provided.
| Param | Description | Input |
|---|---|---|
|
text |
|
|
|
https://www.google.pt |
|
|
|
lui-main-layout |
|
|
|
navigate |
|
Description
Link is used to emulate the link_to method.
Arguments
| Property | Type | Default | Description |
|---|---|---|---|
url |
String | Required | Url to redirect to when clicking the component |
text |
String | nil |
Text to render instead of showing the full url |
data |
Hash | {} | Data attributes |
turbo_target |
String | "lui-main-layout" | data-turbo-target attribute |
turbo_action |
String | "navigate" | data-turbo-action attribute |
* |
Any extra options will be passed to the anchor tag |
Slots
If you pass the default content slot, the link will render that content instead of the url or text.