Skip to main content

Count

Count renders the number of search results.

Useful to display the total number of results after a search.

The component is not displayed while executing the search query or if there are no results.

Usage​

<Count />

Props​

  • label Function optional

    An optional function to wrap the component with a prefix and suffix string.
    E.g. label={(cmp) => <> Found {cmp} results</>} />

  • overridableId String optional

    An optional string to define a specific overridable id.

Usage when overriding​

const MyCount = ({ totalResults }) => {
return <div>Found {totalResults} results.</div>;
}

const overriddenComponents = {
"Count.element": MyCount
};

Parameters​

  • totalResults Number

    The current value of the total results state representing the number of results.