Tree view
Color
Element | Property | Color token |
---|---|---|
Label | text color |
|
Caret icon | svg |
|
Node icon | svg |
|
Node | background-color |
|
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Closed and open states for tree-view](/static/6c6cdaffcea544735f5a4064bbf2e017/3cbba/tree-view-style-1.png)
Example of closed (top) and open (bottom) tree view states.
Interactive states
State | Element | Property | Color token |
---|---|---|---|
Hover | Label | text-color |
|
Caret icon | svg |
| |
Node icon (optional) | svg |
| |
Node | background-color |
| |
Focus | Node | border |
|
Selected | Label | text-color |
|
Caret icon | svg |
| |
Node icon (optional) | svg |
| |
Node | background-color |
| |
border-left |
| ||
Selected + hover | Label | text-color |
|
Caret icon | svg |
| |
Node icon (optional) | svg |
| |
Node | background-color |
| |
Disabled | Label | text-color |
|
Caret icon | svg |
| |
Node icon (optional) | svg |
| |
Node | background-color |
|
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Examples of the interactive states for tree-view](/static/823760bcfb4f8d42c12c81f698f506c3/3cbba/tree-view-style-2.png)
Typography
Element | Font-size (px/rem) | Font-weight | Type token |
---|---|---|---|
Label | 14 / 0.875 | Regular / 400 |
|
Structure
The internal structure of each node varies depending on the node type and level. The labels of nodes on the same level should always vertically align. Do not mix text-only and icon nodes together as this will misalign labels.
Element | Property | px / rem | Spacing token |
---|---|---|---|
Node | padding-right | 16 / 1 |
|
Caret icon | margin-right | 8 / .5 |
|
Tree view (text only)
Node type | Level | Property | px / rem | Spacing token |
---|---|---|---|---|
Branch | First | padding-left | 16 / 1 |
|
Second | padding-left | 32 / 2 |
| |
Third | padding-left | 48 / 3 |
| |
Fourth | padding-left | 64 / 4 |
| |
Leaf | First | padding-left | 40 / 2.5 |
|
Second | padding-left | 56 / 3.5 | – | |
Third | padding-left | 72 / 4.5 | – | |
Fourth | padding-left | 88 / 5.5 | – |
![Examples of text-only tree view node structures](/static/08851240ef3038f99c9f0cf526e0d386/3cbba/tree-view-style-3.png)
Structure and spacing measurements for text only tree view | px / rem
Tree view (with icons)
Node type | Level | Property | px / rem | Spacing token |
---|---|---|---|---|
Branch | First | padding-left | 16 / 1 |
|
Second | padding-left | 40 / 2.5 |
| |
Third | padding-left | 64 / 4 |
| |
Fourth | padding-left | 88 / 5.5 | – | |
Leaf | First | padding-left | 40 / 2.5 |
|
Second | padding-left | 64 / 4 |
| |
Third | padding-left | 88 / 5.5 | – | |
Fourth | padding-left | 112 / 7 | – |
![Examples of tree view with icons node structures](/static/ef38f2f21272fb1b0129d565e677db29/3cbba/tree-view-style-4.png)
Structure and spacing measurements for tree view with icons | px / rem