Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-infinite-scroll>

@methane-ui/ui~9.0 KB brotli (cold + Lit)~2.6 KB marginal

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

Interactive StageLive Custom Element · <mth-infinite-scroll> (@methane-ui/ui)
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalseStops automatic intersection loading and disables manual fallback triggers.
completecompletebooleanfalseMarks the stream as having no further items.
autoLoadauto-loadbooleantrueEnables IntersectionObserver-driven automatic loading.
thresholdthresholdnumber0.1IntersectionObserver threshold (0..1) for triggering loadMore().
rootMarginroot-marginstring"100px"IntersectionObserver rootMargin string.
dataSource—unknown | nullnullOptional DataSource<T> connected to DataController.
renderItem—(item: unknown, index: number) => unknown—Optional custom renderer for items returned by DataController.

Events

EventDetail TypeDescription
mth-load-more{ cursor: string | null }Cancelable event emitted when requesting the next page/cursor.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothLoad-more or retry fallback button is focusedTriggers loading the next batch of items

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-infinite-scroll.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(loading), :state(complete), :state(disabled), :state(error), :state(empty).Conformance suite
i18nRoutes 7 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test