Socket
Book a DemoInstallSign in
Socket

@make-use-of/scroll-horiz

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@make-use-of/scroll-horiz

Lightweight smooth horizontal scrolling. Respects prefers-reduced-motion.

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@make-use-of/scroll-horiz

Lightweight, dependency-free smooth horizontal scrolling for any element. Respects prefers-reduced-motion.

Install

npm install @make-use-of/scroll-horiz

Quick start

import scrollHoriz from '@make-use-of/scroll-horiz';

// Call once on the client (e.g., after mount)
scrollHoriz();

// Then use the standard API
document.querySelector('.carousel').scrollBy(300, 0);

API

  • scrollHoriz(): void — initializes the enhancer.
  • After init, element.scrollBy(x, y) performs smooth horizontal scrolling when motion is allowed.

Notes:

  • Honors prefers-reduced-motion: reduce (instant scroll, no animation).
  • Works even if the browser supports CSS scroll-behavior.
  • Use in browser-only lifecycles (useEffect, onMounted, etc.).

Keywords

scroll

FAQs

Package last updated on 06 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts