pagination
Scáileán liosta Scáileán liosta ginearálta le teideal, barra uirlisí agus rónna a oibríonn ar dheasc agus ar fón.
Stiall uimhrithe de ghnáthnaisc, ionas go maireann leathanú fiú agus JavaScript múchta.
Tá gach sampla beo, ach ní théann a naisc áit ar bith. Taispeánann HTML an marcáil le cóipeáil.
I lár liosta fhada
<nav rst-pagination aria-label ="Leathanaigh na bpostálacha" >
<a href ="/posts?page=3" rst-pagination-step ="prev" ><svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="m6 9 6 6 6-6" /></svg ><span rst-pagination-word >Roimhe seo</span ></a >
<a href ="/posts?page=1" >1</a >
<span rst-pagination-gap aria-hidden ="true" >…</span >
<a href ="/posts?page=3" rst-pagination-wide >3</a >
<span aria-current ="page" >4</span >
<a href ="/posts?page=5" rst-pagination-wide >5</a >
<span rst-pagination-gap aria-hidden ="true" >…</span >
<a href ="/posts?page=9" >9</a >
<a href ="/posts?page=5" rst-pagination-step ="next" ><svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="m6 9 6 6 6-6" /></svg ><span rst-pagination-word >Ar aghaidh</span ></a >
</nav >
In aip, shroichfeadh sé seo /posts?page=1, /posts?page=3, /posts?page=5, /posts?page=9. Anseo ní théann a naisc ná a fhoirmeacha áit ar bith.
An chéad leathanach, ainm inrochtana réamhshocraithe
Is é aria-label an nav an focal simplí "Leathanaigh". Abair cén liosta a leathanaíonn sé nuair a bhíonn níos mó ná ceann amháin ar leathanach.
<nav rst-pagination aria-label ="Leathanaigh" >
<span rst-pagination-disabled rst-pagination-step ="prev" ><svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="m6 9 6 6 6-6" /></svg ><span rst-pagination-word >Roimhe seo</span ></span >
<span aria-current ="page" >1</span >
<a href ="/posts?page=2" >2</a >
<a href ="/posts?page=2" rst-pagination-step ="next" ><svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="m6 9 6 6 6-6" /></svg ><span rst-pagination-word >Ar aghaidh</span ></a >
</nav >
In aip, shroichfeadh sé seo /posts?page=2. Anseo ní théann a naisc ná a fhoirmeacha áit ar bith.