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
The icon to be used in the button. This icon will appear to the **left** of the text content. Supports three formats:
270
+
The icon to be used in the button. This icon will appear to the **left** of the text content.
271
271
272
-
- **Font Awesome icons**: Use icon names like `fa-solid fa-rocket`. Pro and Brand Icons from Font Awesome are supported.
273
-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
274
-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
The icon to be used in the button. This icon will appear to the **right** of the text content. Supports three formats:
279
-
280
-
- **Font Awesome icons**: Use icon names like `fa-solid fa-arrow-right`. Pro and Brand Icons from Font Awesome are supported.
281
-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
282
-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
276
+
The icon to be used in the button. This icon will appear to the **right** of the text content.
277
+
278
+
<Markdown src="/snippets/icons.mdx" />
283
279
284
280
By default, the `rightIcon` for a `filled` button is set to `arrow-right`.
Copy file name to clipboardExpand all lines: fern/products/docs/pages/navigation/overview.mdx
+15-52Lines changed: 15 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,62 +199,27 @@ navigation:
199
199
200
200
## Sidebar icons
201
201
202
-
Add icons next to sections and pages using the `icon` key. Icons support three formats:
202
+
Add icons next to sections and pages using the `icon` key.
203
203
204
-
- **Font Awesome icons**: Use icon names like `fa-regular fa-home`. Pro and Brand Icons from Font Awesome are supported.
205
-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the YAML file where the icon is declared.
206
-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
207
-
208
-
### Font Awesome icons
204
+
<Markdown src="/snippets/icons.mdx" />
209
205
210
206
{/* <!-- vale off --> */}
211
-
```yaml Example navigation config with Font Awesome icons
207
+
```yaml Example config with different icon files {3, 6, 9}
To use custom image files as icons, upload your image files to your docs assets folder, then reference them using relative paths. Paths are resolved relative to the YAML file where the icon is declared.
227
-
228
-
{/* <!-- vale off --> */}
229
-
```yaml Example navigation config with custom image icons
230
-
navigation:
231
-
- section: Products
232
-
icon: ./assets/icons/products-icon.svg
233
-
contents:
234
-
- page: Product A
235
-
icon: ./assets/icons/product-a.png
236
-
path: ./pages/product-a.mdx
237
-
- page: Product B
238
-
icon: ./assets/icons/product-b.png
239
-
path: ./pages/product-b.mdx
240
-
```
241
-
{/* <!-- vale on --> */}
242
-
243
-
### Inline SVG icons
244
-
245
-
You can also provide inline SVG strings directly in your configuration. Wrap the SVG in quotes to ensure proper YAML parsing.
246
-
247
-
{/* <!-- vale off --> */}
248
-
```yaml Example navigation config with inline SVG icons
You can add a link to an external page within your sidebar navigation with the following configuration:
@@ -277,11 +242,9 @@ navigation:
277
242
278
243
## Tabs
279
244
280
-
Within the navigation, you can add `tabs`. Tabs are used to group sections together. The example below shows tabs for `Help Center`, `API Reference`, and an external link to `Github`. Each tab has a `title` and `icon`. Icons support three formats:
245
+
Within the navigation, you can add `tabs`. Tabs are used to group sections together. The example below shows tabs for `Help Center`, `API Reference`, and an external link to `Github`. Each tab has a `title` and `icon`.
281
246
282
-
- **Font Awesome icons**: Use icon names like `puzzle` or `fa-solid fa-puzzle`. [Browse the icons available](https://fontawesome.com/icons) from Font Awesome. Pro and Brand Icons are supported.
283
-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the YAML file where the icon is declared.
284
-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
247
+
<Markdown src="/snippets/icons.mdx" />
285
248
286
249
<CodeBlock title="docs.yml">
287
250
{/* <!-- vale off --> */}
@@ -290,13 +253,13 @@ Within the navigation, you can add `tabs`. Tabs are used to group sections toget
Copy file name to clipboardExpand all lines: fern/products/docs/pages/navigation/products.mdx
+28-59Lines changed: 28 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,7 @@ navigation:
57
57
```
58
58
</CodeBlock>
59
59
<CodeBlock title="products/product-b.yml">
60
+
60
61
```yaml
61
62
tabs:
62
63
api:
@@ -90,65 +91,33 @@ tabs:
90
91
91
92
To define a product, add an item to the `products` list in `docs.yml`, specifying the `display-name` and `path`.
92
93
93
-
The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`.
94
-
95
-
<Note>If you provide both an `image` and an `icon`, the `image` will take precedence.</Note>
96
-
97
-
### Product icons
98
-
99
-
Product icons support three formats:
100
-
101
-
- **Font Awesome icons**: Use icon names like `fa-solid fa-leaf`. Pro and Brand Icons from Font Awesome are supported.
102
-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
103
-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
104
-
105
-
#### Font Awesome icons
106
-
107
-
<CodeBlock title="docs.yml">
108
-
```yaml
109
-
products:
110
-
- display-name: Product A
111
-
path: ./products/product-a.yml
112
-
icon: fa-solid fa-leaf
113
-
slug: product-a
114
-
subtitle: Product A subtitle
115
-
```
116
-
</CodeBlock>
117
-
118
-
#### Custom image files
119
-
120
-
To use custom image files as product icons, upload your image files to your docs assets folder, then reference them using relative paths. Paths are resolved relative to the `docs.yml` file.
121
-
122
-
<CodeBlock title="docs.yml">
123
-
```yaml
124
-
products:
125
-
- display-name: Product A
126
-
path: ./products/product-a.yml
127
-
icon: ./assets/icons/product-a-icon.svg
128
-
slug: product-a
129
-
subtitle: Product A subtitle
130
-
- display-name: Product B
131
-
path: ./products/product-b.yml
132
-
icon: ./assets/icons/product-b-icon.png
133
-
slug: product-b
134
-
subtitle: Product B subtitle
135
-
```
136
-
</CodeBlock>
137
-
138
-
#### Inline SVG icons
139
-
140
-
Wrap the SVG in quotes to ensure proper YAML parsing.
The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`. If you provide both an `image` and an `icon`, the `image` will take precedence.
-**Font Awesome icons**: Use icon names like `fa-solid fa-rocket`. Pro and Brand Icons from Font Awesome are supported.
3
+
-**Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
4
+
-**Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
0 commit comments