File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
docs/src/content/docs/components
packages/starlight/user-components Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ Other content is also supported in asides.
4949</Aside >
5050
5151<Aside type = " danger" >Do not give your password to anyone.</Aside >
52+
53+ <Aside icon = " heart" >
54+ Aside with a custom icon. The icon must be part of starlight's icon list.
55+ </Aside >
5256````
5357
5458<Fragment slot = " markdoc" >
@@ -73,6 +77,10 @@ Other content is also supported in asides.
7377{% aside type="danger" %}
7478Do not give your password to anyone.
7579{% /aside %}
80+
81+ {% aside icon="heart" %}
82+ Aside with a custom icon. The icon must be part of starlight's icon list.
83+ {% /aside %}
7684````
7785
7886</Fragment >
@@ -95,6 +103,10 @@ Do not give your password to anyone.
95103
96104 <Aside type = " danger" >Do not give your password to anyone.</Aside >
97105
106+ <Aside icon = " heart" >
107+ Aside with a custom icon. The icon must be part of starlight's icon list.
108+ </Aside >
109+
98110</Fragment >
99111
100112</Preview >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ interface Props {
1212 title? : string ;
1313}
1414
15- let { type = ' note' , title } = Astro .props ;
15+ let { type = ' note' , title, icon } = Astro .props ;
1616
1717if (! asideVariants .includes (type )) {
1818 throw new AstroError (
@@ -30,7 +30,7 @@ if (!title) {
3030
3131<aside aria-label ={ title } class ={ ` starlight-aside starlight-aside--${type } ` } >
3232 <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 }
3434 </p >
3535 <section class =" starlight-aside__content" >
3636 <slot />
You can’t perform that action at this time.
0 commit comments