softdude / scrolltop
A Craft CMS 5 plugin that adds a scroll-to-top button to your site.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Twig
Type:craft-plugin
Requires
- php: >=8.0
- craftcms/cms: ^4.0.0|^5.0.0
README
A lightweight Craft CMS 4/5 plugin that adds a customizable scroll-to-top button to your site.
System Requirements
- Craft CMS: 4.0.0 or later
- PHP: 8.0 or later
- Browser Support: All modern browsers (Chrome, Firefox, Safari, Edge)
Features
- Adds a customizable scroll-to-top button to your frontend
- Control Panel settings for easy customization
- Smooth scrolls the page to the top
- Lightweight: only 2.4 KB minified (1.07 KB gzipped)
- Enable/disable toggle
- Customizable position, colors, size, and animation
Installation
- Run this command in your project directory:
composer require softdude/scrolltop
- Install in Craft by going to Settings → Plugins → Install "Scroll to Top"
Usage
Once installed and enabled, the plugin will automatically add a scroll-to-top button to your site's frontend. The button will appear after scrolling down and will smoothly scroll the page to the top when clicked.
Quick Start
- Install the plugin (see Installation section above)
- Go to Settings → Scroll to Top in your Craft Control Panel
- Configure your preferences (colors, position, size, etc.)
- Save your settings
- Visit your frontend and scroll down to see the button in action!
The button will automatically appear when users scroll past the threshold you set, and disappear when they scroll back to the top.
Customization
All customization is done through the Craft Control Panel:
- Go to Scroll to Top in your Control Panel
- Configure the button settings:
- Enable/Disable: Turn the button on or off
- Position: Choose from bottom-right, bottom-left, top-right, top-left
- Colors: Customize button color, hover color, and text color
- Size: Adjust button size (default: 48px)
- Icon: Choose from various icon types or use custom SVG
- Animation: Enable/disable smooth scrolling and adjust speed
- Threshold: Set scroll distance before button appears
Support
For issues, questions, or custom development, contact: thejahid@icloud.com
You can also create an issue in the plugin repository.