shadow
Infinite Scroll allows you to implement dynamic data loading as users scroll through more content. The element allows you to view any content from a selected endpoint without requiring further interaction, such as clicking the "Load more" button or a link to the next page. The component also displays a loader indicator to inform users when new content is being loaded.
The size attribute defines the number of items each time new content is loaded.
The Infinite scroll element can be used in combination with any Elements element. For example Card.
The sample connects the infinite scroll to a custom data source instead of a predefined list, so it's closer to real-world use in an application.
Use wje-infinite-scroll when you want to solve a given UI problem consistently within the WebJET design system.
Do not use a component outside of its responsibility; in an unusual case, prefer to assemble multiple smaller components.
Check keyboard controls, focus states, contrast and clear naming of interactive elements.
- Prefer API component over manual DOM interventions.
- Stick to design tokens and consistent naming conventions.
- Before deployment, test the component in real data scenarios.
| Popis | Riadi správanie voľby object-name v komponente. |
| Atribút | object-name |
| Typ | any |
| Predvolené | data |
| Názov | Popis |
|---|
wje-infinite-scroll:click-item | Vyvolá sa pri odoslaní udalosti wje-infinite-scroll:click-item. |
wje-infinite-scroll:start | Vyvolá sa pri odoslaní udalosti wje-infinite-scroll:start. |
wje-infinite-scroll:load | Vyvolá sa po dokončení asynchrónneho načítania obsahu. |
wje-infinite-scroll:finish | Vyvolá sa pri odoslaní udalosti wje-infinite-scroll:finish. |
wje-infinite-scroll:complete | Vyvolá sa pri odoslaní udalosti wje-infinite-scroll:complete. |
loadPages
| Popis | Načíta stránky z dostupných zdrojov komponentu. |
| Signatúra | (page: number) => void |
| Popis | Pridá položku do spravovanej kolekcie komponentu. |
| Signatúra | (item: any, place: any) => void |
| Popis | Odstráni položku z aktuálneho stavu komponentu. |
| Signatúra | (item: any) => void |
| Popis | Obnoví stav komponentu na počiatočné hodnoty. |
| Signatúra | () => void |
| Názov | Popis |
|---|
loader | Štýluje shadow časť loader. |
| Názov | Popis |
|---|
--wje-infinite-scroll-width | Vlastná CSS premenná, ktorá riadi width. |
--wje-infinite-scroll-height | Vlastná CSS premenná, ktorá riadi height. |
| Názov | Popis |
|---|
default | Predvolený slot pre hlavný obsah komponentu. |