diff --git a/docs/src/modules/components/MarkdownDocsV2.js b/docs/src/modules/components/MarkdownDocsV2.js index 8833babea4b493..cef3c473ccc059 100644 --- a/docs/src/modules/components/MarkdownDocsV2.js +++ b/docs/src/modules/components/MarkdownDocsV2.js @@ -81,7 +81,7 @@ export default function MarkdownDocsV2(props) { const localizedDoc = docs[userLanguage] || docs.en; // Generate the TOC based on the tab - const demosToc = localizedDoc.toc.filter((item) => item.text !== 'API'); + const demosToc = localizedDoc.toc; function createHookTocEntry(hookName, sectionName, hookProps = {}) { const hookPropToc = []; @@ -275,11 +275,7 @@ export default function MarkdownDocsV2(props) { {commonElements} {activeTab === '' && localizedDoc.rendered - // for the "hook only" edge case, for example Base UI autocomplete - .slice( - i, - localizedDoc.rendered.length - (localizedDoc.headers.components.length > 0 ? 1 : 0), - ) + .slice(i) .map((renderedMarkdownOrDemo, index) => ( 0) { + if (headers.components.length > 0 && headers.productId !== 'base-ui') { contents.push(` ## API