Bottom Table of Contents Wrapper
If you want to display something entirely different below the Table of Contents, you can use the BottomTableOfContentsWrapper
component. This component is a wrapper around the default Table of Contents and allows you to display additional content below the default Table of Contents.
This means that you can exchange the card component with whatever you want.
Here is an example:
-
Create the component
TableOfContents.astro
:src/components/TableOfContents.astro ---import Default from '@astrojs/starlight/components/TableOfContents.astro'import BottomTableOfContentsWrapper from 'starlight-cooler-credit/components/BottomTableOfContentsWrapper.astro'---<Default><slot /></Default><BottomTableOfContentsWrapper><p>Hello, Astronaut! π¨βπ</p></BottomTableOfContentsWrapper> -
Override the default
TableOfContents
component in yourastro.config.mjs
:astro.config.mjs export default defineConfig({integrations: [starlight({components: {TableOfContents: "./src/components/TableOfContents.astro",},}),],});
You can see the result in the right Table of Contents (if youβre not on a mobile device) β‘οΈ