Nunjucks macro
Copiar código Nunjucks
{% from "components/pagination/_macro.pagination.njk" import componentPagination %}
{{ componentPagination({
"id" : "without-previous-page-disabled" ,
"hasSelect" : true,
"idPrefix" : "pagination-without-previous-page-disabled" ,
"totalItems" : "64" ,
"itemsPerPage" : "10" ,
"items" : [
{
"value" : "1" ,
"text" : 1
},
{
"value" : "2" ,
"text" : 2 ,
"selected" : true
},
{
"value" : "3" ,
"text" : 3
},
{
"value" : "4" ,
"text" : 4
},
{
"value" : "5" ,
"text" : 5
},
{
"value" : "6" ,
"text" : 6
}
],
"previousText" : "Anterior" ,
"nextText" : "Siguiente" ,
"showFirst" : true,
"showLast" : true,
"firstText" : "Primera" ,
"lastText" : "Última" ,
"attributes" : {
"aria-label" : "Paginación"
}
}) }}
HTML
Copiar código HTML
<div id ="without-previous-page-disabled" class ="lg:flex lg:flex-wrap lg:items-center lg:gap-base" >
<nav class ="flex flex-wrap items-center flex-1 mb-base lg:mb-0 text-sm" aria-label ="Paginación" >
<p id ="without-previous-page-disabled-label" class ="w-full mb-xs text-sm text-neutral-dark" >
Selecciona para cargar datos automáticamente
</p >
<button class ="c-button c-button--sm c-button--transparent mr-xs" id ="pagination-without-previous-page-disabled-first" >
<svg xmlns ="http://www.w3.org/2000/svg" viewBox ="0 0 24 24" width ="1em" height ="1em" class ="self-center h-2.5 w-2.5 mr-2" aria-hidden ="true" focusable ="false" >
<g >
<path d ="M10.42,12a2.64,2.64,0,0,1,.77-1.88L20.73.58a1.77,1.77,0,0,1,2.5,2.5l-8.74,8.74a.27.27,0,0,0,0,.36l8.74,8.74a1.77,1.77,0,0,1-2.5,2.5l-9.54-9.54A2.64,2.64,0,0,1,10.42,12Z" fill ="currentColor" > </path >
<path d ="M.25,12A2.65,2.65,0,0,1,1,10.12L10.57.58a1.77,1.77,0,0,1,2.5,2.5L4.33,11.82a.25.25,0,0,0,0,.36l8.74,8.74a1.77,1.77,0,0,1-2.5,2.5L1,13.88A2.65,2.65,0,0,1,.25,12Z" fill ="currentColor" > </path >
</g >
</svg > <span class ="sr-only" > Página </span >
Primera<span class ="sr-only" > : Página 1 con los resultados del 0 al 10</span >
</button >
<button class ="c-button c-button--sm c-button--transparent mr-xs" id ="pagination-without-previous-page-disabled-previous" >
<svg xmlns ="http://www.w3.org/2000/svg" viewBox ="0 0 140 140" width ="1em" height ="1em" class ="self-center h-2.5 w-2.5 mr-2" aria-hidden ="true" focusable ="false" >
<path d ="M54.87 71.77a2.5 2.5 0 010-3.54L106 17.07A10 10 0 1091.89 2.93L35.43 59.39a15 15 0 000 21.22l56.46 56.46A10 10 0 10106 122.93z" fill ="currentColor" />
</svg > <span class ="sr-only" > Página </span >
Anterior<span class ="sr-only" > : Página 1 con los resultados del 0 al 10</span >
</button >
<div class ="flex flex-wrap items-center w-full lg:w-auto pl-sm" >
<p class ="lg:hidden mr-xs text-sm text-neutral-dark" > Página actual:</p >
<div class ="c-form-group -mt-sm mb-0 mr-xs" >
<label class ="block sr-only" for ="without-previous-page-disabled-listbox" > Selecciona una página</label >
<select class ="c-select block mt-sm transition duration-150 ease-in-out border-black rounded-sm font-semibold focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base disabled:bg-neutral-light disabled:border-neutral-base c-select--sm c-select--transparent" id ="without-previous-page-disabled-listbox" name ="without-previous-page-disabled-listbox" aria-describedby ="without-previous-page-disabled-label" >
<option value ="1" > 1</option >
<option value ="2" selected > 2</option >
<option value ="3" > 3</option >
<option value ="4" > 4</option >
<option value ="5" > 5</option >
<option value ="6" > 6</option >
</select >
</div >
</div >
<button class ="c-button c-button--sm c-button--transparent mr-xs" id ="pagination-without-previous-page-disabled-next" >
<span class ="sr-only" > Página </span >
Siguiente<span class ="sr-only" > : Página 3 con los resultados del 20 al 30</span > <svg xmlns ="http://www.w3.org/2000/svg" viewBox ="0 0 140 140" width ="1em" height ="1em" class ="self-center h-2.5 w-2.5 ml-2" aria-hidden ="true" focusable ="false" >
<path d ="M34 137.07a10 10 0 010-14.14l51.13-51.16a2.5 2.5 0 000-3.54L34 17.07A10 10 0 0148.11 2.93l56.46 56.46a15 15 0 010 21.22l-56.46 56.46a10 10 0 01-14.11 0z" fill ="currentColor" />
</svg >
</button >
<button class ="c-button c-button--sm c-button--transparent mr-xs" id ="pagination-without-previous-page-disabled-last" >
<span class ="sr-only" > Página </span >
Última<span class ="sr-only" > : Página 3 con los resultados del 20 al 30</span > <svg xmlns ="http://www.w3.org/2000/svg" viewBox ="0 0 24 24" width ="1em" height ="1em" class ="self-center h-2.5 w-2.5 ml-2" aria-hidden ="true" focusable ="false" >
<g >
<path d ="M13.58,12a2.64,2.64,0,0,1-.77,1.88L3.27,23.42a1.77,1.77,0,0,1-2.5-2.5l8.74-8.74a.27.27,0,0,0,0-.36L.77,3.08A1.77,1.77,0,0,1,3.27.58l9.54,9.54A2.64,2.64,0,0,1,13.58,12Z" fill ="currentColor" > </path >
<path d ="M23.75,12A2.65,2.65,0,0,1,23,13.88l-9.54,9.54a1.77,1.77,0,0,1-2.5-2.5l8.74-8.74a.25.25,0,0,0,0-.36L10.93,3.08a1.77,1.77,0,0,1,2.5-2.5L23,10.12A2.65,2.65,0,0,1,23.75,12Z" fill ="currentColor" > </path >
</g >
</svg >
</button >
</nav >
<p id ="pagination-without-previous-page-disabled-status" class ="block relative -top-xs lg:mt-8 lg:ml-auto text-sm text-neutral-dark" role ="status" aria-live ="polite" >
<span class ="sr-only" > Posición de paginación: </span > <span class ="sr-only" > resultados del </span > 10 <span aria-label ="al" > -</span > 20 de 64
</p >
</div >