Skip to content

Commit 5d0b96f

Browse files
committed
fix: update link card documentation
1 parent 99dc0a2 commit 5d0b96f

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

content/v5.x.x/cards/link.mdx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ const char* url = link.value();
4444
- **Parameters:** None
4545
- **Returns:** `const char*` — The current URL value.
4646

47+
### `setTarget(const char* target)`
48+
Set the target for the link. This can be `_blank` (default), `_self`, etc. `_blank` will open the link in a new tab and `_self` will open it in the same tab.
49+
```cpp
50+
link.setTarget("_blank");
51+
```
52+
- **Signature:** `void setTarget(const char* target)`
53+
- **Parameters:**
54+
- `const char* target` — The target attribute for the link.
55+
- **Returns:** `void`
56+
57+
### `target()`
58+
Get the current target for the link.
59+
```cpp
60+
const char* target = link.target();
61+
```
62+
- **Signature:** `const char* target()`
63+
- **Parameters:** None
64+
- **Returns:** `const char*` — The current target attribute.
65+
4766
## Reference
4867

4968
A complete example showing how to use the Link Card in a real project. This demonstrates initialization, setting the URL, and updating it dynamically.
@@ -54,8 +73,8 @@ dash::LinkCard link(dashboard, "Test Link");
5473
void setup() {
5574
// ...
5675

57-
// Set URL for the link
58-
link.setValue("https://espdash.pro");
76+
link.setValue("https://espdash.pro"); // Set URL for the link
77+
link.setTarget("_blank"); // Open in new tab
5978
}
6079

6180
void loop() {

0 commit comments

Comments
 (0)