InstantSearch / Angular / V4 / API reference

Ais-Hits-Per-Page | Angular InstantSearch V4 (Deprecated)

Deprecated content
Angular InstantSearch is deprecated. Please use InstantSearch.js instead. For more information, see Migrating from Angular InstantSearch.

Signature

Signature
<ais-hits-per-page
  [items]="object[]"
></ais-hits-per-page>

Import

1
2
3
4
5
6
7
8
import { NgAisHitsPerPageModule } from 'angular-instantsearch';

@NgModule({
  imports: [
    NgAisHitsPerPageModule,
  ],
})
export class AppModule {}

1. Follow additional steps in Optimize build size to ensure your code is correctly bundled.
2. This imports all the widgets, even the ones you don’t use. Read the Getting started guide for more information.

About this widget

The ais-hits-per-page widget displays a dropdown menu to let users change the number of displayed hits.

If you only want to configure the number of hits per page without displaying a widget, you can use the configure widget with the hitsPerPage search parameter.

Examples

1
2
3
4
5
6
<ais-hits-per-page
  [items]="[
    { label: '8 hits per page', value: 8, default: true },
    { label: '16 hits per page', value: 16 },
  ]"
></ais-hits-per-page>

Props

items

Required
Type: object[]

List of available options.

1
2
3
4
5
6
<ais-hits-per-page
  [items]="[
    { label: '8 hits per page', value: 8, default: true },
    { label: '16 hits per page', value: 16 },
  ]"
></ais-hits-per-page>
Did you find this page helpful?