PHPackages                             hk2/scrolltop - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hk2/scrolltop

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

hk2/scrolltop
=============

Scroll Top adds an intuitive icon at the bottom-right corner of each page so that with one click you will be at the top of the page. No more dragging of the scroll bar. It will be just fun and ergonomic to use. Scroll Top is an uncomplicated free Open Source Magento Module allowing site visitors to immediately and seamlessly get back to the top of your web page after scrolling a lengthy pages.

v2.1.0(1mo ago)1101OSL-3.0ShellPHP ^8.1 || ^8.2 || ^8.3 || ^8.4CI passing

Since May 12Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/basantmandal/magento2-scrolltop-module)[ Packagist](https://packagist.org/packages/hk2/scrolltop)[ RSS](/packages/hk2-scrolltop/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (3)Versions (8)Used By (0)

HK2 Scroll Top
==============

[](#hk2-scroll-top)

[![Version](https://camo.githubusercontent.com/3efbc7c4697b39e5dbd603ce75f9ae808caed1e1c5e92dbba7ebcc35cbada4aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e312e302d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/3efbc7c4697b39e5dbd603ce75f9ae808caed1e1c5e92dbba7ebcc35cbada4aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e312e302d626c75653f7374796c653d666c61742d737175617265)[![License](https://camo.githubusercontent.com/a3fd2257982f64afbde00a66a8ab5984ee3f6e176f00eb2ec4ea61d862bc113b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4f534c2d2d332e302d677265656e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/a3fd2257982f64afbde00a66a8ab5984ee3f6e176f00eb2ec4ea61d862bc113b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4f534c2d2d332e302d677265656e3f7374796c653d666c61742d737175617265)[![Magento](https://camo.githubusercontent.com/5c0e69cb7da2670c8c31d9baa7de3bb6e955ec4847f236b0c025d24cd587ac54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342e342d2d322e342e392d6639373331363f7374796c653d666c61742d737175617265266c6f676f3d6d6167656e746f266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/5c0e69cb7da2670c8c31d9baa7de3bb6e955ec4847f236b0c025d24cd587ac54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342e342d2d322e342e392d6639373331363f7374796c653d666c61742d737175617265266c6f676f3d6d6167656e746f266c6f676f436f6c6f723d7768697465)[![PHP](https://camo.githubusercontent.com/ad4f93eecb5fbaab9df06144c39ec979001e451fe5c303f11692bf6ba2aa14b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e31253230253743253743253230382e32253230253743253743253230382e33253230253743253743253230382e342d3763336165643f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/ad4f93eecb5fbaab9df06144c39ec979001e451fe5c303f11692bf6ba2aa14b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e31253230253743253743253230382e32253230253743253743253230382e33253230253743253743253230382e342d3763336165643f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)[![Downloads](https://camo.githubusercontent.com/cf77e7b4cd725098d947bd0f8e298a213c4174ea05e6df07b886cf35e576a885/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686b322f7363726f6c6c746f703f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hk2/scrolltop)

Overview
--------

[](#overview)

HK2 Scroll Top is an uncomplicated free Open Source Magento Module that adds an intuitive back-to-top button at the corner of each page. It allows visitors to seamlessly navigate back to the top of lengthy web pages.

🎯 Use Cases
-----------

[](#-use-cases)

- **Enhanced UX**: Enhances storefront ergonomics on content-heavy pages like catalogs, blog indexes, or long details screens.
- **Mobile Usability**: Saves mobile users from tedious scrolling gestures.

🚀 Features
----------

[](#-features)

- ⚡ Seamless scroll animation on clicking the back-to-top button.
- ⚙️ Configurable button offset in pixels before it fades in.
- ⏱ Configurable scroll speed in milliseconds.
- 📍 Multiple position options (Bottom Right, Bottom Left, Top Right, Top Left).
- 🎨 Lightweight, native JS initialization utilizing Magento's standard `data-mage-init` system.

🏗 Architecture
--------------

[](#-architecture)

- **Block**: `HK2\ScrollTop\Block\ScrollTop` encodes configuration as JSON for frontend integration.
- **Helper**: `HK2\ScrollTop\Helper\Data` reads configuration and handles scope fallbacks.

🧩 Magento Components
--------------------

[](#-magento-components)

### Blocks

[](#blocks)

- `HK2\ScrollTop\Block\ScrollTop`

### Helpers

[](#helpers)

- `HK2\ScrollTop\Helper\Data`

### Layout XML

[](#layout-xml)

- `view/frontend/layout/default.xml` - Injects CSS stylesheet asset and template block.

📦 Requirements
--------------

[](#-requirements)

- **Magento version**: 2.4.4 - 2.4.9
- **PHP requirements**: 8.1 || 8.2 || 8.3 || 8.4
- **Required Extension**: `HK2_Core`

⚙️ Installation
---------------

[](#️-installation)

1. `composer require hk2/scrolltop`
2. `bin/magento module:enable HK2_ScrollTop`
3. `bin/magento setup:upgrade`
4. `bin/magento setup:di:compile`
5. `bin/magento cache:flush`

🔧 Configuration
---------------

[](#-configuration)

Configure settings under **Stores &gt; Configuration &gt; HK2 &gt; Scroll Top**:

FieldDescription**Enable ScrollTop Button**Enable or disable the button on the storefront.**Button Position**Placement options: Bottom Right, Bottom Left, Top Right, Top Left.**Scroll Offset (px)**Vertically scrolled pixels before the button appears (default: `20`).**Scroll Speed (ms)**Duration of the scroll to top animation in milliseconds (default: `600`).Usage
-----

[](#usage)

Once enabled, scroll down any frontend storefront page beyond your configured offset. Click the arrow button to slide back to the top of the page.

🗄 Database Changes
------------------

[](#-database-changes)

Not Applicable

📂 Module Structure
------------------

[](#-module-structure)

```
Block/
└── ScrollTop.php
Helper/
└── Data.php
Model/
└── Config/
    └── Source/
        └── Position.php
etc/
├── adminhtml/
│   ├── menu.xml
│   └── system.xml
├── frontend/
│   └── di.xml
├── acl.xml
├── config.xml
└── module.xml
view/
└── frontend/
    ├── layout/
    │   └── default.xml
    ├── templates/
    │   └── scrolltop.phtml
    └── web/
        ├── css/
        │   └── scrollTop.css
        └── js/
            └── scroll-top.js

```

📈 Performance Considerations
----------------------------

[](#-performance-considerations)

The JS component executes outside layout recalculations, utilizing basic fade effects to keep storefront interaction fluid.

🔐 Security Considerations
-------------------------

[](#-security-considerations)

- **Secure Config Paths**: Custom administrative ACL is defined under `HK2_ScrollTop::core_config` in `etc/acl.xml`.

Compatibility
-------------

[](#compatibility)

Reference: [docs/compatibility.md](docs/compatibility.md)

PlatformSupported VersionsMagento2.4.4 - 2.4.9PHP8.1, 8.2, 8.3, 8.4🛠 Troubleshooting
-----------------

[](#-troubleshooting)

### Button does not appear on scroll

[](#button-does-not-appear-on-scroll)

Ensure that you scroll past the offset value defined in configuration (default 20px). Verify that the cache is flushed: `bin/magento cache:flush`.

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! If you'd like to improve the installer:

- ⭐ **Star this repository** (Helps others find it!)
- 🍴 Fork the project
- 🐛 Report bugs
- 💡 Suggest new features
- 🤝 Contribute improvements

Every ⭐ helps increase the visibility of the project and motivates further development.

⚖️ Disclaimer
-------------

[](#️-disclaimer)

The author provides this installation script "as is" without any warranties. Users are responsible for ensuring that running this script complies with their internal security and software requirements.

🤝 Support
---------

[](#-support)

For bug reports, feature requests, and general support:

- **Author**: Basant Mandal
- **Email**:
- **Website**:

License
-------

[](#license)

This project is licensed under the OSL 3.0 License. See the [LICENSE.txt](LICENSE.txt) file for details.

---

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance94

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~298 days

Recently: every ~274 days

Total

6

Last Release

32d ago

Major Versions

v1.2.0 → v2.0.02026-06-08

PHP version history (3 changes)1.0.0PHP ^7.3.0|^7.4.0|^8.0|^8.1.0

1.1.0PHP ^7.3.0|^7.4.0|^8.0|^8.1.0|^8.2.0

v1.2.0PHP ^8.1 || ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/ffa270f1557c4c55c55fec1ad6f2544170980c8dd7f679c10582a3736f7d3a4c?d=identicon)[basantmandal](/maintainers/basantmandal)

---

Top Contributors

[![basantmandal](https://avatars.githubusercontent.com/u/69835601?v=4)](https://github.com/basantmandal "basantmandal (51 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (2 commits)")

---

Tags

hk2magento2magento2-extension-freemagento2-module-freeuiextensionscrollmagento2uxmagento2 extensionscroll-to-topuser experienceHK2Basantmagento moduleback to topscrolltopHK2\_ScrollTopbasantmandal

### Embed Badge

![Health badge](/badges/hk2-scrolltop/health.svg)

```
[![Health](https://phpackages.com/badges/hk2-scrolltop/health.svg)](https://phpackages.com/packages/hk2-scrolltop)
```

###  Alternatives

[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69362.0k](/packages/run-as-root-magento2-prometheus-exporter)[myparcelnl/magento

A Magento 2 module that creates MyParcel labels

1861.2k](/packages/myparcelnl-magento)[angeo/module-llms-txt

Magento 2 module for AI Engine Optimization (AEO). Generates spec-compliant llms.txt and llms-full.txt per llmstxt.org standard, plus streaming JSONL for vector indexing. Multi-store, multi-website, CLI, cron, async admin UI, Page Builder-aware sanitization, customer-group pricing, atomic writes, ETag/Cache-Control, .md mirrors.

132.2k](/packages/angeo-module-llms-txt)[bluezed/yii2-scroll-top

This Yii 2 widget adds a simple scroll-to-top button to your site.

1056.6k](/packages/bluezed-yii2-scroll-top)[mage-os/module-llm-txt

AI-powered LLMs.txt generation for Magento 2 / Mage-OS stores. Help AI systems understand your store with OpenAI-generated content.

245.7k](/packages/mage-os-module-llm-txt)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1015.1k29](/packages/loki-magento2-components)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
