Skip to content

Commit 48323e6

Browse files
authored
Add dropdowns (#520)
* Add dropdowns * add images
1 parent 274f37b commit 48323e6

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed

images/dropdowns-dark.png

234 KB
Loading

images/dropdowns-light.png

208 KB
Loading

navigation/divisions.mdx

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Tabs and Anchors
2+
title: Tabs, Anchors, Dropdowns
33
---
44

55
## Tabs
@@ -42,46 +42,89 @@ documentation.
4242

4343
## Anchors
4444

45-
Anchors are another way to section your content.
45+
Anchors are another way to section your content. They show up on top of your side navigation.
4646

4747
<Frame>
4848
<img className="block dark:hidden rounded-md" src="/images/anchor-light.png" />
4949

5050
<img className="hidden dark:block rounded-md" src="/images/anchor-dark.png" />
5151
</Frame>
5252

53-
The configuration is very similar to the tab configuration.
53+
The configuration is very similar to the tab configuration. We highly recommend that you set an `icon` field as well.
54+
The icon values are [fontawesome icons](https://fontawesome.com/search)
5455

5556
```json docs.json
5657
"navigation": {
5758
"anchors": [
59+
{
60+
"anchor": "Documentation",
61+
"icon": "book-open",
62+
"pages": [
63+
"quickstart",
64+
"development",
65+
"navigation"
66+
]
67+
}
5868
{
5969
"anchor": "API References",
70+
"icon": "sqaure-terminal",
6071
"pages": [
6172
"api-reference/get",
6273
"api-reference/post",
6374
"api-reference/delete"
6475
]
65-
},
76+
}
6677
{
67-
"anchor": "SDKs",
78+
"anchor": "Blog",
79+
"href": "https://external-link.com/blog"
80+
}
81+
]
82+
}
83+
```
84+
85+
## Dropdowns
86+
87+
<Frame>
88+
<img className="block dark:hidden rounded-md" src="/images/dropdowns-light.png" />
89+
90+
<img className="hidden dark:block rounded-md" src="/images/dropdowns-dark.png" />
91+
</Frame>
92+
93+
Dropdowns show up in the same place as anchors, but are consolidated into a single dropdown.
94+
We also recommend that you set an icon for each dropdown item ([options](https://fontawesome.com/search)).
95+
```json docs.json
96+
"navigation": {
97+
"dropdowns": [
98+
{
99+
"dropdown": "Documentation",
100+
"icon": "book-open",
68101
"pages": [
69-
"sdk/fetch",
70-
"sdk/create",
71-
"sdk/delete",
102+
"quickstart",
103+
"development",
104+
"navigation"
72105
]
73-
},
106+
}
74107
{
75-
"anchor": "Blog",
108+
"dropdown": "API References",
109+
"icon": "sqaure-terminal",
110+
"pages": [
111+
"api-reference/get",
112+
"api-reference/post",
113+
"api-reference/delete"
114+
]
115+
}
116+
{
117+
"dropdown": "Blog",
76118
"href": "https://external-link.com/blog"
77119
}
78120
]
79121
}
80122
```
81123

124+
82125
## Nested Hierarchy
83126

84-
You can use both anchors and tabs together - either one can be nested within each other interchangeably.
127+
You can use any combination of anchors, tabs, and dropdowns - either one can be nested within each other interchangeably.
85128

86129
<CodeGroup>
87130

0 commit comments

Comments
 (0)