Add showTitle option to tableOfContent and id to style it (#2472)

* Enhance Table of Contents: Add customizable title display option and update TOC title element with an ID

* add changeset

* remove showTitle option and add toc-title ID for styling
This commit is contained in:
German Jablonski
2025-10-22 09:50:12 +08:00
committed by GitHub
parent 29ce826b29
commit de0ce6dc85
3 changed files with 8 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-ui': patch
---
Add a `toc-title` ID to the table of contents heading for styling purposes
@@ -108,6 +108,8 @@ import { DocsPage } from 'fumadocs-ui/page';
</DocsPage>;
```
You can also style the TOC title with the `toc-title` ID.
### Last Updated Time
Display last updated time of the page.
+1
View File
@@ -20,6 +20,7 @@ import type { AnchorProviderProps } from 'fumadocs-core/toc';
export function PageTOCTitle(props: ComponentProps<'h2'>) {
return (
<h3
id="toc-title"
{...props}
className={cn(
'inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground',