When using Algolia’s createLocalStorageRecentSearchesPlugin to display recent searches in Autocomplete, you can control how many recent search entries are shown using the limit parameter.
Is there a maximum limit?
There is no hard-coded maximum for the limit parameter. You can technically set it to any number. However, keep in mind that:
The higher the limit, the more data must be stored and retrieved from localStorage
Displaying a long list of searches can negatively affect UI performance and page load speed
Some browsers may impose storage size limits on
localStorage, which could impact reliability at high volumes
Best practice: test for your environment
While there’s no enforced upper bound, we recommend testing different values to find what performs well for your specific use case. Consider:
The average number of searches your users perform
Your app's target device types (e.g., mobile vs. desktop)
The available memory and processing power
The expected speed of rendering the UI components
Summary
No strict max limit, you choose the number.
Higher values can slow down your UI or exceed browser storage limits.
Always test with real-world usage to find the ideal number for your app.