https://github.com/hypebright/scroll-to-top-shiny
Creating a "scroll to top" button in Shiny that becomes visible when the user starts to scroll the page
https://github.com/hypebright/scroll-to-top-shiny
Last synced: 3 months ago
JSON representation
Creating a "scroll to top" button in Shiny that becomes visible when the user starts to scroll the page
- Host: GitHub
- URL: https://github.com/hypebright/scroll-to-top-shiny
- Owner: hypebright
- License: gpl-2.0
- Created: 2023-11-08T08:16:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-16T15:47:03.000Z (about 1 year ago)
- Last Synced: 2024-08-13T07:03:28.408Z (6 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - hypebright/scroll-to-top-shiny - Creating a "scroll to top" button in Shiny that becomes visible when the user starts to scroll the page (JavaScript)
README
# Scroll to Top button in Shiny ✨
Creating a "scroll to top" button in Shiny that becomes visible when the user starts to scroll the page. When the user clicks on the button, the `scrollTop` position gets set back to 0.
A solution using plain HTML, CSS and JavaScript that works in both a simple Shiny layout generated with `fluidPage()` and `bslib` layouts generated with `page_navbar()` and `page_sidebar()`. Note that other layout might require other classes to be targeted. For more information about what class to target you can watch the YouTube video below.
# View tutorial on YouTube 🎥
[Watch the tutorial](https://youtu.be/8p0-MQp91QU) on my YouTube channel!