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
Use the `html` type to render custom HTML within the item's `<li>` tag.
167
+
168
+
This can be useful for inserting custom items such as dividers, section titles, ads, and images.
169
+
170
+
```ts
171
+
typeSidebarItemHtml= {
172
+
type:'html';
173
+
value:string;
174
+
defaultStyle?:boolean; // Use default menu item styles
175
+
className?:string;
176
+
};
177
+
```
178
+
179
+
Example:
180
+
181
+
```js title="sidebars.js"
182
+
module.exports= {
183
+
myHtmlSidebar: [
184
+
// highlight-start
185
+
{
186
+
type:'html',
187
+
value:'<img src="sponsor.png" alt="Sponsor" />', // The HTML to be rendered
188
+
defaultStyle:true, // Use the default menu item styling
189
+
},
190
+
// highlight-end
191
+
],
192
+
};
193
+
```
194
+
195
+
:::tip
196
+
197
+
The menu item is already wrapped in an `<li>` tag, so if your custom item is simple, such as a title, just supply a string as the value and use the `className` property to style it:
198
+
199
+
```js title="sidebars.js"
200
+
module.exports= {
201
+
myHtmlSidebar: [
202
+
{
203
+
type:'html',
204
+
value:'Core concepts',
205
+
className:'sidebar-title',
206
+
},
207
+
],
208
+
};
209
+
```
210
+
211
+
:::
212
+
163
213
### Category links {#category-link}
164
214
165
215
With category links, clicking on a category can navigate you to another page.
0 commit comments