Backtotop
Scroll to top button
A floating button that appears when scrolling down, allowing users to quickly return to the top of the page.
Usage
Props
| prop | type | default | description |
|---|---|---|---|
| threshold | number | 400 | Scroll distance before button appears |
| className | string | - | Additional CSS classes |
Example
The button appears after scrolling 400px:
Styling
The component uses these CSS variables:
--bg-surface- Button background--border-line- Button border--bg-bg- Hover background--text-fg- Icon color