An Angular 22 application demonstrating the framework-agnostic
wts-scroll package.
The example includes:
- A vertical activity feed with a custom interaction-aware scrollbar.
- Typed scroll progress, scroll-end, reach-end, and overflow events.
- Infinite-style page loading when the feed reaches its end.
- Programmatic start/end navigation and position save/restore.
- Runtime track-visibility configuration.
- A horizontal, wheel-enabled native snap gallery.
npm install
npm startOpen http://localhost:4200.
Install and register the standards-based custom element:
npm install wts-scrollimport { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
import 'wts-scroll/element';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `
<wts-scroll
style="display:block;height:24rem"
direction="vertical"
reach-end-offset="12%"
(reach-end)="loadMore()"
>
<article>Scrollable Angular content</article>
</wts-scroll>
`,
})
export class FeedComponent {
loadMore(): void {
// Append the next page of content.
}
}The scroll element must have a definite height. It exposes standard DOM events
and methods such as scrollToStart(), scrollToEnd(), saveState(), and
restoreState().
npm test -- --watch=false
npm run build