← All Components
<mth-infinite-scroll>
Infinite scroll container combining ObserverPoolController IntersectionObserver sentinel observation, DataController cursor/cache orchestration, and an accessible button fallback.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-infinite-scroll>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/infinite-scroll"></script>
<mth-infinite-scroll auto-load threshold="0.1">Example</mth-infinite-scroll>import '@methane-ui/ui/infinite-scroll';
import '@methane-ui/react';
export function Example() {
return <mth-infinite-scroll auto-load threshold="0.1">Example</mth-infinite-scroll>;
}<script setup lang="ts">
import '@methane-ui/ui/infinite-scroll';
</script>
<template>
<mth-infinite-scroll auto-load threshold="0.1">Example</mth-infinite-scroll>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/infinite-scroll';
import { MthInfiniteScrollDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthInfiniteScrollDirective],
template: `<mth-infinite-scroll auto-load threshold="0.1">Example</mth-infinite-scroll>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/infinite-scroll';
import MthInfiniteScroll from '@methane-ui/svelte/MthInfiniteScroll.svelte';
</script>
<MthInfiniteScroll auto-load threshold="0.1">Example</MthInfiniteScroll>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
disabled | disabled | boolean | false | Stops automatic intersection loading and disables manual fallback triggers. |
complete | complete | boolean | false | Marks the stream as having no further items. |
autoLoad | auto-load | boolean | true | Enables IntersectionObserver-driven automatic loading. |
threshold | threshold | number | 0.1 | IntersectionObserver threshold (0..1) for triggering loadMore(). |
rootMargin | root-margin | string | "100px" | IntersectionObserver rootMargin string. |
dataSource | — | unknown | null | null | Optional DataSource<T> connected to DataController. |
renderItem | — | (item: unknown, index: number) => unknown | — | Optional custom renderer for items returned by DataController. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-load-more | { cursor: string | null } | Cancelable event emitted when requesting the next page/cursor. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | Load-more or retry fallback button is focused | Triggers loading the next batch of items |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 1 APG keyboard transitions across LTR/RTL. | mth-infinite-scroll.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(loading), :state(complete), :state(disabled), :state(error), :state(empty). | Conformance suite |
| i18n | Routes 7 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |