#is it possible to use custom icons on starlight cards instead of the ones in the built in library
5 messages · Page 1 of 1 (latest)
Hi @toxic mural. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the provided knowledge sources, Starlight cards support adding icons via the icon attribute, but the icon must be set to the name of one of Starlight’s built-in icons. There is no documented support for using custom icons directly on cards through the icon attribute. The documentation specifically states:
Include an icon in a card using the icon attribute set to the name of one of Starlight’s built-in icons.
Components > Cards
Similarly, the icon prop for the <Card> component is described as:
A card can include an icon attribute set to the name of one of Starlight’s built-in icons.
Components > Cards
There is no mention in the documentation of a way to use custom icons (e.g., SVGs or third-party icon sets) directly in the Card component’s icon slot.
If you need to use custom icons, you would likely need to create a custom card component or override the default Card component, but this is not described in the official documentation.
Summary:
No, according to the current Starlight documentation, you cannot use custom icons on cards via the icon attribute; only built-in icons are supported for this feature.
Components > Cards
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@toxic mural Kapa.ai is still learning and improving, please let me know how I did by reacting below.
sigh