x
1
2
3
4
5
6
7
8
9
<div class='lui-link'><a href="https://www.google.pt" data-turbo-target="lui-main-layout" data-turbo-action="navigate" target="_blank"> <span id="lui-token_5793709857" class="lui-token lui-entity-token lui-entity-token-general lui-tag-token" style="color: #c81720; border-color: #f9b3b7;"> <img class="lui-token__icon-img" src="horse"> <span class="lui-token__text">tag</span> <div class="lui-token__actions"> </div> </span></a></div>Link
Description
Related components
| Used Components | Components where is Used |
|---|---|
| Label |
Usage rules
- ✅ Do
- ❌ Don't
1
2
3
<%= 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") do %> <%= render LooposUi::TagToken.new(text: "tag", icon: :horse) %><% end %>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.