diff --git a/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx b/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx
index 8c6966975..0638e5ba1 100644
--- a/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx
+++ b/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx
@@ -84,7 +84,8 @@ export function DynamicTabs(
);
}, [id, tabs, tabsState]);
- const position: string = 'top';
+ const position: string = 'top'; // TODO: Get position from tab block options
+ const description = null; // TODO: Get description from tabs
// To avoid issue with hydration, we only use the state from localStorage
// once the component has been mounted.
@@ -145,16 +146,23 @@ export function DynamicTabs(
return (
3 ? 'md:flex-wrap' : '',
- // 'after:bg-tint-12/1',
- // if last tab is selected, apply rounded to :after element
- // '[&:has(button.active-tab:last-of-type):after]:rounded-bl-md'
+ 'overflow-x-auto',
+ 'md:overflow-hidden',
+
+ 'gap-1',
+ 'pb-2',
+ 'flex-row',
+
+ position === 'left' || position === 'right'
+ ? 'gap-2 md:max-w-[40%] md:flex-col'
+ : '',
+ 'snap-x',
+ 'snap-mandatory',
+
+ // We need to inset the tablist to make edge-to-edge scrolling work.
+ '-mx-4',
+ 'px-4',
+ 'scroll-px-4',
+ 'sm:-mx-6',
+ 'sm:px-6',
+ 'sm:scroll-px-6',
+ 'md:mx-0',
+ 'md:px-0',
+ 'md:scroll-px-0'
)}
>
{tabs.map((tab) => (
-