Installation
import { WrBackTop } from 'ngwr/back-top';
@Component({ imports: [WrBackTop] })
export class MyComponent {}Demo
Scroll down past 400px to reveal the button in the bottom-right corner. The sandbox below provides the scroll runway.
<wr-back-top visibilityThreshold="400" [offset]="80" />API
| Name | Description | Type | Default |
|---|---|---|---|
visibilityThreshold | Show the button once window.scrollY exceeds this many pixels. | number | 400 |
offset | Pixel offset subtracted from the scroll target — for sticky headers. | number | 0 |
ariaLabel | Accessible label for the button. Falls back to backTop.label, then 'Back to top'. | string | null | null |