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
InstUI provides various typography tokens on theme and component level as well.
10
+
11
+
## Typography components
12
+
13
+
Your every text-based need should be covered by one of our two typography components, namely `<Text>` and `<Heading>`.
14
+
These components have a `variant` prop with a handful of semantic values to choose from. These values describe multiple aspects of the text, such as `font-weight`, `font-size`, `line-height` and for `<Heading>` the DOM element that should be rendered, (i.e.:`<h1>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`).
15
+
16
+
While you can set all these properties separately as well, our strong recommendation is to use the variant with semantic values and only deviate from it in cases absolutely necessary.
17
+
18
+
## <Text>
19
+
20
+
Here is the list of semantic variant values and what they do in `<Text>`
21
+
22
+
This is always rendered as `<span>`
23
+
24
+
The values (e.g.:`weightRegular`) are from the currently used theme's typography sections, for example:
Here is the list of semantic variant values and how are they rendered in `<Heading>`
40
+
41
+
| variant | dom element |
42
+
| ---------------- | ----------- |
43
+
| titlePageDesktop | h1 |
44
+
| titlePageMobile | h1 |
45
+
| titleSection | h2 |
46
+
| titleCardSection | h2 |
47
+
| titleModule | h3 |
48
+
| titleCardLarge | h4 |
49
+
| titleCardRegular | h4 |
50
+
| titleCardMini | h4 |
51
+
| label | h5 |
52
+
| labelInline | h5 |
53
+
54
+
## Legacy values
55
+
56
+
For compatibility reasons we still provide the legacy typography tokens (xxLarge, medium, etc.) so updating InstUI is easier but these tokens shouldn't be used when creating new screens. The following tokens are deprecated from the `themes`, more specifically from `theme.typography`
Copy file name to clipboardExpand all lines: packages/ui-heading/src/Heading/README.md
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,31 @@ describes: Heading
4
4
5
5
Heading is a component for creating typographic headings.
6
6
7
+
## Variant
8
+
9
+
Variant takes care of - almost - all use-cases when it comes hedings on pages. Their name reflects the places they meant to be used. It sets the `level` prop and takes care of the style of the heading
10
+
We recommend using `variants` instead of the `level` (and `as`) props.
11
+
12
+
NOTE: when `variant` is set, `level` and `as` props are ignored
0 commit comments