#Large data options in Select
12 messages · Page 1 of 1 (latest)
10k rows of data is a lot, I assume this is more than the recommended 128kB page size? (I know Next uses max 128kB to prevent performance issues because the data needs to be parsed.)
you need to make a custom component for this, thankfully it isn't too hard
i made one recently with 223,000 select options
it works with react-window to virtualise the options
generating a lot of results in js is usually pretty quick, but mounting is not performant
so you use a virtualisation library to only mount what you need
here's a code example i made when studying how to do the implementation @rugged valley
https://codesandbox.io/s/mantine-menu-virtualisation-jw2iq4
if react-window isn't too your liking, there are a lot of other libraries you can try, @dull garden sent me a big list
So the ones that I tried were.
https://github.com/TanStack/virtual
https://github.com/bvaughn/react-window
https://github.com/bvaughn/react-virtualized
https://github.com/caseywebdev/react-list
https://github.com/jaredLunde/masonic
https://github.com/jaredLunde/mini-virtual-list
https://github.com/petyosi/react-virtuosoThey all had their own issues. So for me, it's a case of going through each one and finding which satisfies the use case.
🤖 Headless UI for Virtualizing Large Element Lists in JS/TS, React, Solid, Vue and Svelte - GitHub - TanStack/virtual: 🤖 Headless UI for Virtualizing Large Element Lists in JS/TS, React, Solid, Vue...
React components for efficiently rendering large lists and tabular data - GitHub - bvaughn/react-window: React components for efficiently rendering large lists and tabular data
React components for efficiently rendering large lists and tabular data - GitHub - bvaughn/react-virtualized: React components for efficiently rendering large lists and tabular data
:scroll: A versatile infinite scroll React component. - GitHub - caseywebdev/react-list: A versatile infinite scroll React component.
the data is resulted from an API call
@novel spear woah man, thanks a lot