@@ -4,6 +4,7 @@ import FwbPaginationExampleIcons from './pagination/examples/FwbPaginationExampl
44import FwbPaginationExampleNavigation from ' ./pagination/examples/FwbPaginationExampleNavigation.vue' ;
55import FwbPaginationExampleNavigationIcons from ' ./pagination/examples/FwbPaginationExampleNavigationIcons.vue' ;
66import FwbPaginationExampleSlots from ' ./pagination/examples/FwbPaginationExampleSlots.vue' ;
7+ import FwbPaginationExampleSlotsAdvanced from ' ./pagination/examples/FwbPaginationExampleSlotsAdvanced.vue' ;
78import FwbPaginationExampleTable from ' ./pagination/examples/FwbPaginationExampleTable.vue' ;
89import FwbPaginationExampleCustomLength from ' ./pagination/examples/FwbPaginationExampleCustomLength.vue' ;
910import FwbPaginationExampleCustomLabels from ' ./pagination/examples/FwbPaginationExampleCustomLabels.vue' ;
@@ -268,6 +269,84 @@ const currentPage = ref(1)
268269</script>
269270```
270271
272+ ## Advanced slots example
273+
274+ <fwb-pagination-example-slots-advanced />
275+
276+ ``` vue
277+ <template>
278+ <fwb-pagination
279+ v-model="currentPage"
280+ :total-items="100"
281+ enable-first-last
282+ >
283+ <template #first-button="{ disabled, setPage }">
284+ <button
285+ class="disabled:cursor-not-allowed ml-0 flex h-8 items-center justify-center border border-purple-300 bg-purple-200 px-3 leading-tight text-gray-500 first:rounded-l-lg last:rounded-r-lg hover:bg-purple-300 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
286+ :disabled="disabled"
287+ @click="setPage()"
288+ >
289+ First page
290+ </button>
291+ </template>
292+
293+ <template #last-button="{ disabled, setPage, page }">
294+ <button
295+ class="disabled:cursor-not-allowed ml-0 flex h-8 items-center justify-center border border-purple-300 bg-purple-200 px-3 leading-tight text-gray-500 first:rounded-l-lg last:rounded-r-lg hover:bg-purple-300 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
296+ :disabled="disabled"
297+ @click="setPage()"
298+ >
299+ Last page ({{ page }})
300+ </button>
301+ </template>
302+
303+ <template #prev-button="{ disabled, decreasePage }">
304+ <button
305+ class="disabled:cursor-not-allowed ml-0 flex h-8 items-center justify-center border border-purple-300 bg-purple-200 px-3 leading-tight text-gray-500 first:rounded-l-lg last:rounded-r-lg hover:bg-purple-300 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
306+ :disabled="disabled"
307+ @click="decreasePage()"
308+ >
309+ Prev page
310+ </button>
311+ </template>
312+
313+ <template #next-button="{ disabled, increasePage }">
314+ <button
315+ class="disabled:cursor-not-allowed ml-0 flex h-8 items-center justify-center border border-purple-300 bg-purple-200 px-3 leading-tight text-gray-500 first:rounded-l-lg last:rounded-r-lg hover:bg-purple-300 hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
316+ :disabled="disabled"
317+ @click="increasePage()"
318+ >
319+ Next page
320+ </button>
321+ </template>
322+
323+ <template #page-button="{ disabled, page, setPage }">
324+ <button
325+ class="disabled:cursor-not-allowed ml-0 flex h-8 items-center justify-center border border-purple-300 px-3 leading-tight text-gray-500 first:rounded-l-lg last:rounded-r-lg hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
326+ :class="{
327+ 'bg-purple-200 hover:bg-purple-300': !disabled,
328+ 'bg-purple-300': disabled
329+ }"
330+ :disabled="disabled"
331+ @click="setPage(page)"
332+ >
333+ {{ page }}
334+ </button>
335+ </template>
336+ </fwb-pagination>
337+ Current page: {{ currentPage }}
338+ </template>
339+
340+ <script lang="ts" setup>
341+ import { ref } from 'vue'
342+
343+ import { FwbPagination } from '../../../../src/index'
344+
345+ const currentPage = ref<number>(1)
346+ </script>
347+
348+ ```
349+
271350## API
272351
273352### Props
0 commit comments