Skip to content

InfiniteScroll ​

Load more at the end

Loads the next page as the reader nears the end of a feed. It suits browsing (a timeline, search results you skim); for results people come back to, share or need the footer of, Pagination is kinder.

Basic
  • 第1話
  • 第2話
  • 第3話
  • 第4話
  • 第5話
  • 第6話
  • 第7話
  • 第8話
  • 第9話
  • 第10話
  • 第11話
  • 第12話
  • @load gets a done callback: call done() when the page is in, done(true) when there are no more. While loading, "Loading more" (loadingText) is announced.
  • disabled pauses it and turning it back on resumes. Where scrolling can't trigger loading (no IntersectionObserver), a Load more button (moreLabel) takes its place.

Usage ​

ts
import { BlessInfiniteScroll } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
disabledboolean—stop observing (no more pages)
offsetnumber200px before the end to fire
rootHTMLElement | null—scroll container ref; default = nearest scrollable ancestor / viewport
doneTextstring—
loadingTextstring"Loading more"read while a page loads (the spinner is decorative)
moreLabelstring"Load more"label of the button shown where scrolling can't trigger loading

Events

NamePayloadDescription
load[done: (finished?: boolean | undefined) => void]

Slots

NameScopeDescription
default—
loading—
done—

Exposed

NameTypeDescription
reset() => boolean

Released under the MIT License. Character names and artwork belong to their owners.