Add slot to LinkCard #3214
Replies: 3 comments
-
|
Thanks for the suggestion @michsco. Do you have some examples of the kind of content you have wanted to add to link cards before? Would be helpful to know to think about the intended use cases. |
Beta Was this translation helpful? Give feedback.
-
|
You can do the following with a import { CardGrid, Card, LinkCard, LinkButton } from '@astrojs/starlight/components';
<Card>
<img src="/assets/images/scholarship-youth.png" />
Request scholarship funds from xyz.
<LinkButton href="...">
Scholarship Funds Request Form
</LinkButton>
</Card>To do this same thing with a |
Beta Was this translation helpful? Give feedback.
-
|
Honestly just in general, having link cards be able to look/work closer to normal cards would be nice. Mostly going off of how pretty the overriden linkcards look on https://docs.papermc.io/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlightare you using?0.34.3
What is your idea?
The
Cardcomponent supports the<slot />, allowing me to build up a complex body for the card. TheLinkCardis an extension of the card concept, yet it doesn't support the<slot />.The proposal is to add
<slot />support to theLinkCardto bring it to parity withCard. Without this support, I have to generate the HTML.Why is this feature necessary?
It isn't strictly necessary, but it does create parity between the two components. It is trying to solve the case where I switch from a regular Card to a linked card.
Do you have examples of this feature in other projects?
Card.astro implements this behavior and could easily be ported over.
Participation
Beta Was this translation helpful? Give feedback.
All reactions