UNPKG

mbn-react-google-reviews

Version:

Google Reviews Component which will bis in reactc component and is used by millions of developers

144 lines (66 loc) โ€ข 2.6 kB
๐Ÿ“ฆ mbn-react-google-reviews A clean, customizable React component library for displaying Google-style customer reviews โ€” perfect for eCommerce, SaaS, service providers, and agencies. ๐Ÿš€ Installation npm install mbn-react-google-reviews โœจ Features โ€ข ๐Ÿ’… Fully styled with Tailwind CSS โ€ข ๐Ÿ’ฌ Display reviews with avatars, star ratings, and animation โ€ข ๐ŸŽฅ Smooth entrance animations via Framer Motion โ€ข ๐Ÿ”Œ Accepts static data or future Google Places API support โ€ข ๐Ÿงฑ Developer-friendly props โ€ข ๐ŸŽฏ Built for React & Next.js ๐Ÿ”ง Usage Basic Example import { GoogleReviewWidget } from "mbn-react-google-reviews"; const reviews = [ { author: "Mobin Hussaini", rating: 5, text: "Amazing quality and excellent support!", date: "June 29, 2025", avatar: "https://randomuser.me/api/portraits/men/75.jpg", }, ]; export default function HomePage() { return ( <GoogleReviewWidget reviews={reviews} showTitle={true} ctaLabel="Leave your review" onCTAClick={() => alert("Redirect to Google review form")} /> ); } ๐Ÿงฉ Props Prop Type Default Description reviews Review[] [] Array of reviews to display (required if no placeId) placeId string undefined (Planned) Google Places place ID apiKey string undefined (Planned) Google API Key layout "grid" | "slider" "grid" Layout style โ€” currently supports only grid showTitle boolean true Whether to show the section title titleText string "Customer Reviews" Title heading text descriptionText string "Hear what our customers say..." Subheading text ctaLabel string "Leave a Review" Label for CTA button onCTAClick () => void undefined Action triggered when CTA is clicked ๐Ÿงช Review Object Structure Each review should have: type Review = { author: string; rating: number; // from 1 to 5 text: string; date?: string; avatar?: string; // optional image URL }; ๐Ÿ“˜ Future Roadmap โœ… Publish to npm ๐Ÿ”œ Google Places API integration ๐Ÿ”œ Carousel layout using keen-slider or swiper ๐Ÿ”œ Dark mode support ๐Ÿ”œ Star filter & review analytics ๐Ÿ› ๏ธ Requirements React 18+ Tailwind CSS (or import index.css from the package manually) Works with CRA, Vite, and Next.js ๐Ÿ“ License MIT ยฉ 2025 Mohammad Mobin Hussaini