Next.js is a popular open source JavaScript framework you can choose for building the frontend of your Headless Wagtail website.
There's no specific support for Next.js in Headless Wagtail. This website you're on right now is built with Headless Wagtail and Next.js, so you can have a look at the source code to get an idea how to set up your own project.