Skip to main content
Next.js ships with a <Script> component that loads external scripts at the right moment in the page lifecycle. Use it to load the Tally widget and call Tally.loadEmbeds() from onReady, which runs every time the page mounts. onLoad only runs the first time the script loads, so the embed stays empty when a visitor navigates back to the page.
This example targets the Pages Router. For the App Router, render the same <Script> and <iframe> from a Client Component ('use client').