Repository navigation
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Description
In the current state, Docusaurus' autogenerated entries generates tiles looking like this:
Auto-generating entries is a great feature, and in my case, I'd like to use it to get scalable docs, such as listing many partners that my company integrates with.
For this, I would suggest to add the ability to customize the image that we add to the tile. Currently it's either the file or folder icon.
For example, adding this to the sidebar to specify a new image:
{
type: 'category',
label: 'Essentials',
link: {
type: 'generated-index',
title: 'Essentials',
image: 'somelogopath.png' <------- new
description: 'my description',
slug: 'dev/tutorials/essentials',
},
items: [
'some link',
}
Or when generating tiles from a doc page with:
<DocCardList items={useCurrentSidebarCategory().items}/>
We could perhaps define the image in each entry in the sidebar.js file as well, using longhand notation:
{
type: 'category',
label: 'My page',
link: {
type: 'doc',
id: 'dev/...', <------- contains the DocCardList component
},
items: [
{
type: 'doc',
id: 'myDoc',
image: 'somelogopath.png' <------- new
},
],
}
Has this been requested on Canny?
No response
Motivation
I need this feature for scalability reasons so this feature will happen either on my own repo, but it should ideally be a core feature as it might help other users. I can possibly get a developer to submit a PR to your repo if you can share some pointers on how to do this 'the right way'.
API design
No response
Have you tried building it?
No response
Self-service
- I'd be willing to contribute this feature to Docusaurus myself.

Activity
Josh-Cena commentedon Jul 28, 2022
By "image", you mean the "icon"?
You can already do so by swizzling and passing the source through
customProps. It's very, very hard to design a generalizable API in this case, because most icons aren't images—they are either SVGs, React components, font awesome, or emojis.ArthurFlag commentedon Jul 28, 2022
that's what i meant. yes. Ok brilliant, i'll take a look at this, thanks Josh.
smileypop commentedon Sep 20, 2023
Just saying "swizzle" it doesn't give enough information how to actually do so. Without adding any API changes, it would still be helpful to put some actual code examples in the docs how to achieve custom Link icons on autogenerated category cards.
colinscz commentedon Sep 27, 2023
For everyone coming here. The component you have to swizzle is the DocCard component. I recommend to swizzle it with --eject in order to not modify too much of the original component.
That way in case of potential breaking changes (upcoming v3) the diff and migration effort is hopefully rather small and you can compare newer versions to your old code.
Command used:
npm run swizzle @docusaurus/theme-classic DocCard -- --ejectundergroundwires commentedon Jun 18, 2024
Hope that this can be revisted with proper official way rather than having a workaround/hack that leads to this:
slorber commentedon Jun 20, 2024
@undergroundwires this is not a workaround/hack, this is the official way
You can override whatever we provide, we just want to warn you that we might have to refactor things and you'd need to adjust your code accordingly.
Unsafe might feel a bit too scary but it's perfectly fine to eject it
slorber commentedon Sep 4, 2024
For anyone interested, I explained how to do this here: #10476 (comment)
bvanelli commentedon Oct 23, 2025
I understand that changing this for the arbitrary image case is out of scope, but couldn't the emoji change that @slorber showed be taken as general change? As far as I can tell the original page icon is already an emoji (in this case 📄️), so it could be implemented without much effort. Is there a reasoning against it?
Here are the docs: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter
The extra option could be called
icon. Theimageoption already exists and is used for link expansion for social media.I would of course be willing to implement the feature and writing the documentation for it, if such feature were to be accepted.
slorber commentedon Oct 23, 2025
I would be fine if we worked on designing such a feature on a separate issue, leading to an implementation later.
We could add
iconto sidebar items,iconin_category_.json, andsidebar_iconfront matter in docs.However, wouldn't this be confusing if we could only pass emojis as icons? Also, how do you control what is displayed on the generated index? My intuitive expectation would be that the icon also shows on sidebar items, and not just the generated index. Do we need to create 2 options to decouple the 2?
As you can see, before implementing anything, we need to research and design what should be done exactly.