InstantSearch / React / V6 / API reference

Stats | React InstantSearch V6 (Deprecated)

This version of React InstantSearch has been deprecated in favor of the latest version of React InstantSearch.

Signature

Signature
<Stats
  // Optional parameters
  translations={object}
/>

About this widget

The Stats widget displays the total number of matching hits and the time it took to get them (time spent in the Algolia server).

Examples

1
2
3
import { Stats } from 'react-instantsearch-dom';

<Stats />

Props

translations

Optional
Type: object

A mapping of keys to translation values.

1
2
3
4
5
6
7
8
9
<Stats
  translations={{
    stats(nbHits, processingTimeMS, nbSortedHits, areHitsSorted) {
      return areHitsSorted && nbHits !== nbSortedHits
      ? `${nbSortedHits!.toLocaleString()} relevant results sorted out of ${nbHits.toLocaleString()} found in ${processingTimeMS.toLocaleString()}ms`
      : `${nbHits.toLocaleString()} results found in ${processingTimeMS.toLocaleString()}ms`
    },
  }}
/>
Did you find this page helpful?