Signature
Import
- Component
- Plugin
To ensure optimal bundle sizes,
see Optimize build size.
Vue
About this widget
Theais-pagination
widget displays a pagination system which lets users change the current page of search results.
Pagination is limited to 1,000 hits per page.
For more information, see Pagination limitations.
Examples
Vue
Props
Whether to display the first page link.
Vue
Whether to display the previous page link.
Vue
Whether to display the next page link.
Vue
Whether to display the last page link.
Vue
How many page links to display around the current page.
Vue
The maximum number of pages to display (and to allow navigating to).
Vue
The CSS classes you can override:
ais-Pagination
. The root of the widget.ais-Pagination--noRefinement
. The root of the widget without refinement.ais-Pagination-list
. The list of the page items.ais-Pagination-item
. The page item of the list.ais-Pagination-item--firstPage
. The “first” item of the list.ais-Pagination-item--lastPage
. The “last” item of the list.ais-Pagination-item--previousPage
. The “previous” item of the list.ais-Pagination-item--nextPage
. The “next” item of the list.ais-Pagination-item--page
. The “page” item of the list.ais-Pagination-item--selected
. The selected item of the list.ais-Pagination-item--disabled
. The disabled item of the list.ais-Pagination-link
. The clickable element of an item.
Vue
Customize the UI
default
The slot to override the complete DOM output of the widget.When you implement this slot,
none of the other slots will change the output,
as the default slot surrounds them.Scope
currentRefinement: number
. The number of the selected page.nbHits: number
. The total number of hits.nbPages: number
. The total number of pages.pages: number[]
. The pages to render in the widget.isFirstPage: boolean
. Whether the current page is the first page.isLastPage: boolean
. Whether the current page is the last page.refine: (value: number) => void
. A function to select the next page.createURL: (value: number) => void
. A function to generate an URL from a refinement.
Vue
HTML output
HTML
If SEO is important for your search page, ensure that your custom HTML is optimized for search engines:
- Use
<a>
tags withhref
attributes to allow search engine bots to follow links. - Use semantic HTML and include structured data when relevant.