);
diff --git a/packages/gitbook/src/components/primitives/ScrollContainer.tsx b/packages/gitbook/src/components/primitives/ScrollContainer.tsx
index aea4079a2..f5a5e132e 100644
--- a/packages/gitbook/src/components/primitives/ScrollContainer.tsx
+++ b/packages/gitbook/src/components/primitives/ScrollContainer.tsx
@@ -4,7 +4,7 @@ import { tString, useLanguage } from '@/intl/client';
import { tcls } from '@/lib/tailwind';
import * as React from 'react';
import { useScrollListener } from '../hooks/useScrollListener';
-import { Button } from './Button';
+import { Button, type ButtonProps } from './Button';
/**
* A container that encapsulates a scrollable area with usability features.
@@ -17,17 +17,26 @@ export type ScrollContainerProps = {
className?: string;
contentClassName?: string;
- /** Optional class(es) to apply when there the container can be scrolled on the leading (left or top) edge */
- leadingEdgeScrollClassName?: string;
-
- /** Optional class(es) to apply when there the container can be scrolled on the trailing (right or bottom) edge */
- trailingEdgeScrollClassName?: string;
-
/** The direction of the scroll container. */
orientation: 'horizontal' | 'vertical';
- /** Whether to fade out the edges of the container. */
- fadeEdges?: ('leading' | 'trailing')[];
+ leading?: {
+ /** Whether to fade out the leading edge of the container. */
+ fade: boolean;
+ /** Whether to show a button to scroll back. */
+ button: boolean | ButtonProps;
+ /** Optional class(es) to apply when there the container can be scrolled on the leading (left or top) edge */
+ className?: string;
+ };
+
+ trailing?: {
+ /** Whether to fade out the trailing edge of the container. */
+ fade: boolean;
+ /** Whether to show a button to scroll forward. */
+ button: boolean | ButtonProps;
+ /** Optional class(es) to apply when there the container can be scrolled on the trailing (right or bottom) edge */
+ className?: string;
+ };
/** The ID or ref of the active item to scroll to. */
active?: string | React.RefObject;
@@ -39,10 +48,9 @@ export function ScrollContainer(props: ScrollContainerProps) {
className,
contentClassName,
orientation,
- fadeEdges = ['leading', 'trailing'],
active,
- leadingEdgeScrollClassName,
- trailingEdgeScrollClassName,
+ leading = { fade: true, button: true },
+ trailing = { fade: true, button: true },
...rest
} = props;
@@ -140,28 +148,30 @@ export function ScrollContainer(props: ScrollContainerProps) {
return (