Signature
Import
- Component
- Plugin
To ensure optimal bundle sizes,
see Optimize build size.
Vue
See this widget in action
Preview this widget and its behavior.
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
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 list item when it’s unavailable.ais-Pagination-link. The clickable element of an item.
Vue
Customize the UI
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 withhrefattributes to allow search engine bots to follow links. - Use semantic HTML and include structured data when relevant.