Skip to main content

Infinite-scroll

shadow

Infinite Scroll umožňuje implementovať dynamické načítavanie dát, keď používatelia prechádzajú väčším množstvom obsahu. Element umožňuje zobraziť akýkoľvek obsah zo zvoleného koncového bodu (endpointu) bez toho, aby bola potrebná ďalšia interakcia, napríklad kliknutie na tlačidlo “Načítať viac” alebo na odkaz na ďalšiu stránku. Komponent zároveň zobrazuje indikátor načítania (loader), aby informoval používateľov o načítavaní nového obsahu.

Počet načítaných položiek (size)

Atribút size definuje počet položiek pri každom načítaní nového obsahu.

Card

Element Infinite scroll je možné použiť v kombinácii s akýmkoľvek Elements elementom. Napríklad Card.

Vlastné dáta

Atribúty a Vlastnosti

totalPages

DescriptionTotal number of pages available for infinite scrolling.
Attributetotal-pages
Typenumber
Defaultundefined

isLoading

DescriptionA field tracking the loading status.
Attributeis-loading
Typeany[]
Defaultundefined

infiniteScrollTemplate

DescriptionTemplate for infinite scroll content.
Attributeinfinite-scroll-template
Typenull
Defaultundefined

response

DescriptionData answers for infinite scrolling.
Attributeresponse
Typeany | {}
Defaultundefined

objectName

DescriptionThe name of the object to be used in infinite scrolling.
Attributeobject-name
Typestring
Defaultundefined

Eventy

No events available for this component.

Metódy

getPages

DescriptionRetrieves pages from the server.
SignaturegetPages(page: number) => Promise<object>

hideLoader

DescriptionHides the loading indicator.
SignaturehideLoader() => void

showLoader

DescriptionDisplays the loader element by adding the 'show' class to its class list. This method is useful for indicating the loading or processing status in the user interface.
SignatureshowLoader() => void

hasMorePages

DescriptionChecks if there are other pages to load.
SignaturehasMorePages(page: number) => boolean

loadPages

DescriptionLoads pages.
SignatureloadPages(page: number) => Promise<void>

addItem

DescriptionAdds an item to the infinite scroll.
SignatureaddItem(item: any, place?: string) => void

removeItem

DescriptionRemoves the item from infinite scrolling.
SignatureremoveItem(item: any) => void

CSS Shadow Parts

NameDescription
native-infinite-scrollRefers to the container of the content element.

CSS Custom Vlastnosti

NameDescription
--wje-infinite-scroll-widthAdjusts the width of the infinite scroll container. This property determines how wide the infinite scroll area will be relative to its parent element. Accepts any valid CSS width value, such as percent (%), pixels (px), or display units (vw). The default value is 100%, which means it takes up the entire width of its container.
--wje-infinite-scroll-heightDefines the height of the infinite scroll container. This property determines how high the infinite scroll area should be. It accepts any valid CSS height value, such as pixels (px), percentages (%), or display units (vh). The default is 300px, which provides a fixed height suitable for most use cases.

Sloty

NameDescription
``Default slot for Infinite scroll.
endingThe content is placed behind the Infinite scroll.
loaderDisplays the loading icon when scrolling.