File tree 2 files changed +11
-2
lines changed
docs/src/content/docs/guides
packages/starlight/user-components
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,10 @@ Other content is also supported in asides.
282
282
</Aside >
283
283
284
284
<Aside type = " danger" >Do not give your password to anyone.</Aside >
285
+
286
+ <Aside icon = " heart" >
287
+ Aside with a custom icon. The icon must be part of starlight's icon list.
288
+ </Aside >
285
289
````
286
290
287
291
The above code generates the following on the page:
@@ -306,6 +310,11 @@ Other content is also supported in asides.
306
310
307
311
<Aside type = " danger" >Do not give your password to anyone.</Aside >
308
312
313
+ <Aside icon = " heart" >
314
+ { ' ' }
315
+ Aside with a custom icon. The icon must be part of starlight's icon list.
316
+ </Aside >
317
+
309
318
Starlight also provides a custom syntax for rendering asides in Markdown and MDX as an alternative to the ` <Aside> ` component.
310
319
See the [ “Authoring Content in Markdown”] ( /guides/authoring-content/#asides ) guide for details of the custom syntax.
311
320
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ interface Props {
12
12
title? : string ;
13
13
}
14
14
15
- let { type = ' note' , title } = Astro .props ;
15
+ let { type = ' note' , title, icon } = Astro .props ;
16
16
17
17
if (! asideVariants .includes (type )) {
18
18
throw new AstroError (
@@ -30,7 +30,7 @@ if (!title) {
30
30
31
31
<aside aria-label ={ title } class ={ ` starlight-aside starlight-aside--${type } ` } >
32
32
<p class =" starlight-aside__title" aria-hidden =" true" >
33
- <Icon name ={ icons [type ]} class =" starlight-aside__icon" />{ title }
33
+ <Icon name ={ icon || icons [type ]} class =" starlight-aside__icon" />{ title }
34
34
</p >
35
35
<section class =" starlight-aside__content" >
36
36
<slot />
You can’t perform that action at this time.
0 commit comments