TheDocumentation Index
Fetch the complete documentation index at: https://docs.velure.dev/llms.txt
Use this file to discover all available pages before exploring further.
Paginator.vue component is a reusable Vue.js component designed for paginating data fetched from a Laravel backend. It works seamlessly with the Laravel pagination structure, displaying pagination links in a visually appealing way. The component uses the @inertiajs/vue3 Link component to navigate between pages while preserving the SPA behavior.
Features
Laravel Pagination Support
Seamlessly handles the data structure returned by Laravel’s model pagination.
Dynamic Links
Automatically generates pagination links using the
links prop.Customizable Navigation
Includes options to preserve scroll state during navigation.
Responsive Design
Features full-width layout with height managed via CSS classes.
Usage
Basic Example
Props
The array of pagination links, typically from Laravel’s pagination data.
Whether to preserve the scroll position when navigating via links.
Whether to emit a click even vs allowing the link URL.
Events
Triggered when the user clicks a link and
emitClickedLink is true.Example with Laravel Data Structure
In your Laravel controller:links field from the Laravel response to the Paginator component. From Inertia form the Laravel model:
Advanced Example with Scroll Preservation
Advanced Example with Emit Link Click
Notes
- Responsive Design: The height of the paginator can be customized using CSS classes, while the width is set to 100%.
- Preserve Scroll: The
preserveScrollprop ensures the scroll position is maintained when navigating between pages. - Dynamic Rendering: The
Paginatorcomponent automatically maps thelinksprop to clickable navigation buttons.