diff --git a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx index 9638b1f08..d69987024 100644 --- a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx +++ b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx @@ -126,31 +126,33 @@ export function SpaceLayout(props: { - {!withTopHeader && searchAndAI} - {!withTopHeader && withSections && sections && ( - - )} - {isMultiVariants && !sections && ( - - )} - + !withTopHeader || isMultiVariants ? ( + // displays the search button and/or the space dropdown in the ToC according to the header/variant settings. E.g if there is no header, the search button will be displayed in the ToC. + <> + {!withTopHeader && searchAndAI} + {!withTopHeader && withSections && sections && ( + + )} + {isMultiVariants && !sections && ( + + )} + + ) : null } />