A TypeScript plugin for BetterScroll that provides enhanced mouse wheel scrolling capabilities with configurable speed, direction, easing, and boundary damping on PC platforms.
Overall
score
98%
Build a mobile-optimized scrollable container with elastic boundary behavior that provides a native-feeling scroll experience.
Create a scrollable container component that:
@generates
interface ScrollOptions {
// Enable/disable scroll on X axis
scrollX?: boolean;
// Enable/disable scroll on Y axis
scrollY?: boolean;
// Configure elastic bounce behavior
// Can be true/false for all edges, or object for per-edge control
bounce?: boolean | {
top?: boolean;
bottom?: boolean;
left?: boolean;
right?: boolean;
};
// Duration of bounce animation in milliseconds
bounceTime?: number;
// Resistance factor when scrolling out of bounds (0-1, lower = more resistance)
outOfBoundaryDampingFactor?: number;
}
interface ScrollInstance {
// Current scroll position
x: number;
y: number;
// Maximum scroll boundaries
maxScrollX: number;
maxScrollY: number;
minScrollX: number;
minScrollY: number;
// Reset scroll position to valid boundaries
resetPosition(time?: number): boolean;
// Cleanup
destroy(): void;
}
export function createScroller(
wrapper: HTMLElement,
options?: ScrollOptions
): ScrollInstance;Provides mobile-optimized scrolling with elastic boundary behavior.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-better-scroll--mouse-wheeldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10