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
Copy file name to clipboardExpand all lines: docs/src/content/docs/guides/sidebar.mdx
+44
Original file line number
Diff line number
Diff line change
@@ -316,6 +316,50 @@ The configuration above generates the following sidebar:
316
316
]}
317
317
/>
318
318
319
+
## Custom HTML attributes
320
+
321
+
Links can also include an `attrs` property to add custom HTML attributes to the link element.
322
+
323
+
In the following example, `attrs` is used to add a `target="_blank"` attribute, so that the link opens in a new tab, and to apply a custom `style` attribute to italicize the link label:
324
+
325
+
```js
326
+
starlight({
327
+
sidebar: [
328
+
{
329
+
label:'Guides',
330
+
items: [
331
+
// An external link to the Astro docs opening in a new tab.
0 commit comments