You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/ui-link/src/Link/README.md
+73-21Lines changed: 73 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,37 +41,91 @@ type: example
41
41
</Link>
42
42
```
43
43
44
-
### Variant
45
-
46
-
In order to make it easy to get the most commonly used links, we have the variant prop. It will set all the necessary styles (fontSize, lineHeight, and textDecoration).
44
+
If neither `href` nor `onClick` is provided, the Link will render as plain text (a `<span>` element) without interactive styling:
47
45
48
46
```js
49
47
---
50
48
type: example
51
49
---
52
50
<div>
53
-
<div>
54
-
In a line of text you should use the <Link variant="inline" renderIcon={<IconUserLine />} href="https://instructure.github.io/instructure-ui/">inline</Link> link variant.
51
+
<Text>This is a Link with no href or onClick:<Link>I look like plain text</Link></Text>
55
52
</div>
53
+
```
56
54
57
-
<br></br>
58
-
<div>
59
-
<Text variant="contentSmall">In a line of text, where the text is smaller, use the <Link variant="inline-small" renderIcon={<IconUserLine />} href="https://instructure.github.io/instructure-ui/">inline-small</Link> link variant
60
-
</Text>
61
-
</div>
55
+
### Size
62
56
63
-
<br></br>
57
+
The `size` prop controls the font size, line height, and icon size, icon gap. Available sizes are `small`, `medium`, and `large`.
58
+
59
+
```js
60
+
---
61
+
type: example
62
+
---
64
63
<div>
65
-
If the link is standalone (not in a text), use the <code>standalone</code><Link display="block" variant="standalone" renderIcon={<IconUserLine />} href="https://instructure.github.io/instructure-ui/">standalone</Link>
The `variant` prop controls the text decoration and intended use case. Available variants are `inline` (underlined, for use within text) and `standalone` (no underline, for standalone links).
88
+
89
+
Use the `variant` prop in combination with the `size` prop to control both the appearance and size of the link.
67
90
68
-
<br></br>
91
+
```js
92
+
---
93
+
type: example
94
+
---
69
95
<div>
70
-
If the link is standalone (not in a text), but smaller, use the <code>standalone-small</code><Link display="block" variant="standalone-small" renderIcon={<IconUserLine />} href="https://instructure.github.io/instructure-ui/">standalone-small</Link>
71
-
</div>
96
+
<div>
97
+
In a line of text you should use the <Link variant="inline" size="medium" renderIcon={<DiamondInstUIIcon />} href="https://instructure.github.io/instructure-ui/">inline</Link> link variant.
98
+
</div>
99
+
<br />
100
+
<div>
101
+
If the link is standalone (not in a text), use the <code>standalone</code> variant:
**The following variant values are deprecated and will be removed in a future version:**
110
+
111
+
-`inline-small`
112
+
-`standalone-small`
113
+
114
+
These deprecated values are still supported for backward compatibility but will trigger console warnings. Please update your code to use the new `variant` + `size` prop combination.
0 commit comments