Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Next.js example showing how to lazy load ads using the built-in Script Component.

An Astro static theme for blogs, knowledge bases, and product documentation, with bilingual routing, Pagefind search, docs sidebars, and dark mode.

Docsy is an Apache-2.0 Hugo theme for technical documentation sites, with built-in navigation, site structure, and PostCSS/Sass build support.
Loading Ads with the Script Component is a Next.js solution example that shows how to lazy-load advertising and other third-party scripts through the framework's built-in Script Component.
Loading Ads with the Script Component is a documentation-style Next.js example, published inside the vercel/examples repository under the solutions/script-component-ad folder, that demonstrates lazy-loading ad scripts with next/script instead of a plain HTML script tag. You provide an ad network's script source, and the Script Component controls when that third-party code is fetched and executed so it does not block the page's first render. The example runs as a standard Next.js app, is styled with Tailwind CSS, and can be deployed to Vercel in one click or bootstrapped locally with create-next-app. A hosted live copy is available at the demo URL linked from the README.
next/script is used to load a third-party ad script with a controlled loading strategy rather than a render-blocking script tag.framework: Next.js metadata.css: Tailwind metadata.script-component-ad.pnpm create next-app --example against the example's GitHub URL to scaffold a local copy.pnpm dev and deployed with Vercel.solutions-script-component-ad.vercel.app shows the lazy-loaded ads working before you build anything.You either deploy the example through the Vercel one-click button or scaffold it locally with pnpm create next-app --example pointing at the repository URL. After installing, pnpm dev starts the Next.js development server, where the Script Component handles the lazy loading of the ad script; the same app is then deployed to Vercel with the standard Next.js deployment flow.
next/script pattern into a production Next.js site to serve ad units without letting third-party code delay page rendering.It is a Next.js example that lazy-loads a third-party ad script using the framework's Script Component, so the ad code loads without blocking the page's initial render. It ships as a deployable repository with a live Vercel demo.
Yes. It is published in the vercel/examples repository as open example code, and both the one-click Vercel deploy and the pnpm create next-app clone workflow are available without a paid license.
The example is built on Next.js and styled with Tailwind CSS, as stated in its repository metadata. It deploys to Vercel and uses pnpm for local development.
Run pnpm create next-app --example with the example's GitHub URL to bootstrap a copy, then run pnpm dev inside the project to start the Next.js development server.
