Skip to content

Next.js Testimonial Widget for App Router and Pages Router

Show customer reviews inside a Next.js application without forcing the widget into server-rendered markup.



The approach works across App Router and Pages Router projects, and across SSR, SSG, ISR, and client-side rendering, because the widget loads after mount in a client component.

Why client-side loading helps in Next.js

A testimonial widget is most useful when it does not dictate how the rest of the page is rendered. Loading it client-side separates two concerns: Next.js renders the page shell and content, while the browser fetches and paints the review display after mount. That separation is the core reason the same setup can be reused in App Router and Pages Router codebases.







Setup checklist

Use this sequence before adding the widget to a production page:

  • Confirm whether the project uses App Router or Pages Router, and note the rendering mode for the target route.
  • Create the provider account and collection form first, so there are real testimonials to display.
  • Add testimonials by sharing the collection link or importing existing reviews from Twitter, ProductHunt, or G2.
  • Create a dedicated client component rather than loading the script directly in a server component.
  • Add 'use client' at the top of the component file to mark that component for client execution, load the script after mount, and render the widget container.
  • Import the client component only where reviews belong, such as a landing page, pricing page, or product section.
  • Test on mobile and desktop, and check for layout shift when the widget appears.





Router and rendering compatibility

App Router projects using Next.js 13 or later need the client-component boundary described above. Pages Router projects can use the same client-loaded pattern. For SSR, SSG, ISR, and client-side rendering, the widget still loads in the browser after the initial page is served. The same logic supports static export and streaming, and deployment is not tied to one host: Vercel, Netlify, AWS, or another platform can serve the Next.js app while the browser loads the widget.







Example: reviews on a landing page

A practical example is a SaaS landing page: the hero and feature sections are rendered by Next.js, while a reviews section near the pricing area imports the client component. If the page is statically generated or incrementally regenerated, visitors still receive the page quickly and the testimonial area fills in after mount. The same component can be reused on a portfolio page for client feedback or on a storefront for product reviews, keeping the integration pattern consistent while the surrounding content changes.





Where teams place the widget

Common placements include SaaS landing pages with customer testimonials, marketing websites with user reviews, e-commerce storefronts with product reviews, and portfolio sites with client feedback. Choose the placement based on the decision the visitor is making at that point on the page, rather than adding the same widget everywhere.

Related React setup

If your project is built with React outside Next.js, or uses Gatsby, Remix, or Create React App, the related React guide covers loading the widget in useEffect to avoid hydration issues.







Frequently asked questions

What is a Next.js testimonial widget?

It is a display component for customer reviews that loads on the client after the page mounts. That client-side loading is why it can sit alongside server-rendered Next.js pages without a hydration mismatch.

How do I add it to App Router?

Put the widget inside a client component marked for the browser, load its script after mount, and render its container. Then import that component into the page or layout where reviews should appear.

Will it affect my Lighthouse score?

The script is loaded asynchronously and does not block the first render, so the page can paint before the widget arrives. The widget itself should still be checked in your own Lighthouse run, especially for layout shift if it expands after loading.

Does it work with static export?

Yes. Because loading happens in the browser, a fully static export can still display the widget after the static page is delivered.

Does it work with ISR?

Yes. Client-side loading is compatible with incremental regeneration, on-demand revalidation, and streaming responses, since the widget does not need to be part of the server-rendered HTML.