Zero-CLS Google Reviews Component for Next.js, Astro, Webflow & Framer
Most embeddable review widgets load 250KB to 420KB of third-party React, Swiper, and stylesheet waterfalls that sabotage Interaction to Next Paint (INP) and trigger hydration mismatches. GMBSync ships as an isolated sub-15KB vanilla script with deterministic container sizing and global edge SWR caching.
Core Web Vitals & Runtime Isolation Benchmark
| Web Vitals Metric | GMBSync v4.2 Widget | Legacy SaaS Widgets | Lighthouse Impact |
|---|---|---|---|
| JS + Scoped CSS Bundle | < 15 KB gzipped | 240 KB – 420 KB | 100 / 100 Perf |
| Cumulative Layout Shift | 0.000 CLS (min-height lock) | 0.10 – 0.28 layout jump | 0.000 CLS |
| Framework Hydration | Zero React / jQuery deps | Often breaks SSR hydration | 0 Console Warnings |
| Cache & Edge Delivery | Edge SWR (300s + 24h) | Origin iframe waterfall | < 45 ms TTFB |
1. Next.js App Router Component (GoogleReviews.tsx)
Uses next/script with strategy="lazyOnload" and a deterministic min-h-[280px] mount container so LCP and React hydration stay completely unaffected:
'use client';
import Script from 'next/script';
export function GoogleReviews({ widgetId }: { widgetId: string }) {
return (
<div className="min-h-[280px] w-full">
<div
id="gmbsync-widget"
data-widget-id={widgetId}
data-layout="carousel"
data-theme="light"
data-min-stars="4"
/>
<Script src="https://gmbsync.com/widget.js" strategy="lazyOnload" />
</div>
);
}
2. Astro & Static Site Component (GoogleReviews.astro)
Ships zero client-side framework bundle on Astro islands while rendering native swipeable Google review cards:
---
interface Props {
widgetId: string;
layout?: 'carousel' | 'grid' | 'strip' | 'badge';
}
const { widgetId, layout = 'carousel' } = Astro.props;
---
<div style="min-height: 280px;">
<div
id="gmbsync-widget"
data-widget-id={widgetId}
data-layout={layout}
data-theme="light"
data-min-stars="4"
></div>
<script is:inline src="https://gmbsync.com/widget.js" async defer></script>
</div>
3. Webflow & Framer Code Embed Block
Paste directly into a Webflow Code Embed element or Framer Embed component with zero external CSS overrides:
<div style="min-height: 280px;">
<div id="gmbsync-widget" data-widget-id="YOUR_WIDGET_ID" data-layout="carousel" data-theme="light" data-min-stars="4"></div>
<script src="https://gmbsync.com/widget.js" async defer></script>
</div>
Preventing React Hydration Warnings, CLS Jumps & INP Lag
Embedding third-party scripts inside React Server Components or Webflow pages routinely fails Lighthouse mobile audits for three predictable engineering reasons:
- Isolate Outside React Virtual DOM: Never inject third-party review markup directly into a React-managed child tree before hydration finishes. Keeping an empty container inside a
'use client'leaf and loadingwidget.jsvianext/script(lazyOnloadorafterInteractive) guarantees React hydration completes with zero mismatch errors. - Reserve Vertical Height by Layout Mode: Pair carousel and grid embeds with a deterministic
min-h-[280px]wrapper (ormin-h-[48px]for inline rating strips). When review cards paint from edge cache, sections below the widget never shift downward, holding Cumulative Layout Shift at0.000. - Zero Third-Party Font or Polyfill Waterfalls: Heavy SaaS widgets pull external Google Font stylesheets, Swiper bundles, and jQuery inside an iframe, stalling Interaction to Next Paint (INP) on mid-tier Android phones. GMBSync inherits your site's existing system or Inter font stack and binds native CSS
scroll-snapwith passive pointer drag listeners.
Next.js, Astro & Webflow Embed FAQ
Will GMBSync cause React hydration mismatch warnings in Next.js App Router?
No. Rendering the empty mount container inside a client boundary and loading widget.js with next/script strategy="lazyOnload" (or afterInteractive) keeps server-rendered HTML and initial React hydration trees identical.
How does GMBSync maintain 0.000 Cumulative Layout Shift (CLS) on mobile?
Because the mount element reserves deterministic vertical space via CSS (min-height) and widget.js renders isolated scoped styles in a single DOM swap, surrounding sections never jump when review cards appear.
Can I use GMBSync across Next.js client-side route transitions without losing widgets?
Yes. Each route mount runs cleanly on page load or re-initialization, so navigating between Next.js routes or Astro View Transitions renders cleanly without duplicate event listeners.
Does the Webflow and Framer embed work on free or starter hosting plans?
Yes. Drop the 2-line container and async script into Webflow Embed elements or Framer Custom Code embeds with zero external NPM packages, webhooks, or API key configuration.