Link
The Link component allows you to add a hyperlink and navigate to the external URL.
Properties​
Properties | Description | Expected Value |
|---|---|---|
| Link target | This property sets the URL where the user needs to be taken on clicking the link. | example: https://dev.to/tooljet or {{queries.xyz.data.url}}. |
| Link text | This property sets the text for the Link component. | example: Click here or Open webpage. |
| Target type | This property specifies the link to be opened in the same tab or new tab on clicking the link. | Options: New Tab & Same Tab. |
Events​
Event | Description |
|---|---|
| On click | Triggered when the link is clicked. |
| On hover | Triggered when the cursor hovers over the link. |
info
Check Action Reference docs to get the detailed information about all the Actions.
Component Specific Actions (CSA)​
The following actions of the link component can be controlled using the component-specific actions(CSA):
Actions | Description | How To Access |
|---|---|---|
| click | Triggers click action of the link component. | Employ a RunJS query to execute component-specific actions such as await components.link1.click() or trigger it using an event. |
| setLinkTarget | Sets the URL the link opens. | await components.link1.setLinkTarget('https://tooljet.com') |
| setLinkText | Sets the text of the link. Only text values are applied. | await components.link1.setLinkText('Open docs') |
| setVisibility | Sets the visibility of the component. | await components.link1.setVisibility(false) |
| setDisable | Disables the component. | await components.link1.setDisable(true) |
| setLoading | Sets the loading state of the component. | await components.link1.setLoading(true) |
If the Link target or Link text property changes later, it replaces the value set with setLinkTarget or setLinkText.
Exposed Variables​
Variable | Description | How To Access |
|---|---|---|
| linkTarget | Holds the current URL of the link. | {{components.link1.linkTarget}} |
| linkText | Holds the current text of the link. | {{components.link1.linkText}} |
| isVisible | Indicates if the component is visible. | {{components.link1.isVisible}} |
| isDisabled | Indicates if the component is disabled. | {{components.link1.isDisabled}} |
| isLoading | Indicates if the component is loading. | {{components.link1.isLoading}} |