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
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,37 @@ type: example
22
22
</View>
23
23
```
24
24
25
+
### Variant
26
+
27
+
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).
28
+
29
+
```js
30
+
---
31
+
type: example
32
+
---
33
+
<div>
34
+
<div>
35
+
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.
36
+
</div>
37
+
38
+
<br></br>
39
+
<div>
40
+
<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
41
+
</Text>
42
+
</div>
43
+
44
+
<br></br>
45
+
<div>
46
+
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>
47
+
</div>
48
+
49
+
<br></br>
50
+
<div>
51
+
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>
52
+
</div>
53
+
</div>
54
+
```
55
+
25
56
### Adding margin
26
57
27
58
Use the `margin` prop to add space to the left or right of the Link. Because
@@ -76,6 +107,8 @@ Use the `renderIcon` property to put an [icon](#icons) inside a Link. To positio
76
107
icon _after_ the link text, change the `iconPlacement` property to `end`. You can also
77
108
render a Link with just an icon. Don't forget to add text for screen readers, though.
78
109
110
+
NOTE: if you want the icon to have the same `font-size` as the link, do not specify its `size`!
0 commit comments