Skip to content

Components

All components are headless by default — they render semantic HTML with data-sr-* attributes you can target with CSS. All components automatically adapt to the shop’s rating type (stars or thumbs) with no manual configuration needed.

Default Styles (Optional)

Ship with polished defaults in one line. Every rule uses :where() for zero specificity, so any custom CSS you write wins automatically — no !important needed.

import '@simplersuite/react/styles.css';

The default theme uses CSS custom properties you can override:

:root {
--sr-primary: #8b5cf6; /* Buttons, links, accents */
--sr-star: #ec4899; /* Star fill color */
--sr-radius: 8px; /* Border radius */
--sr-thumb-up: #16a34a; /* Thumbs up color */
--sr-thumb-down: #dc2626; /* Thumbs down color */
/* See styles.css source for all variables */
}

Or skip the import entirely and style from scratch using the data-sr-* attributes documented below.


ReviewSummary

Displays aggregate rating data for a product. In stars mode, shows the average rating, star display, and 5-bar distribution. In thumbs mode, shows “X% recommend” with a thumb icon and 2-bar distribution (up/down).

ReviewSummary showing 4.1 average with star distribution bars
<ReviewSummary productId="7654321098" />

Props

PropTypeDefaultDescription
productIdstringShopify product ID (required)
classNamestringCSS class name
renderStars(rating: number) => ReactNodeCustom star renderer
renderDistribution(distribution: RatingDistribution) => ReactNodeCustom distribution renderer

Styling

[data-sr-summary] { /* Summary container */ }
[data-sr-summary-rating] { /* Average rating row */ }
[data-sr-distribution] { /* Distribution bars container */ }
[data-sr-distribution-row] { /* Single distribution row */ }
[data-sr-distribution-label] { /* Row label (e.g. "5 stars") */ }
[data-sr-distribution-bar] { /* Bar track */ }
[data-sr-distribution-fill] { /* Bar fill */ }
[data-sr-distribution-count] { /* Row count */ }
[data-sr-empty] { /* Empty state (no reviews) */ }

ReviewList

Displays paginated reviews with a “Load More” button. Automatically renders stars or thumbs per review.

ReviewList showing paginated reviews with ratings, verified badges, and merchant replies
<ReviewList productId="7654321098" perPage={5} sort="newest" />

Custom rendering:

<ReviewList
productId="7654321098"
renderReview={(review, index) => (
<div key={review.id}>
<strong>{review.author.name}</strong>
<p>{review.body}</p>
</div>
)}
/>

Props

PropTypeDefaultDescription
productIdstringShopify product ID (required)
perPagenumber10Reviews per page
sortReviewSortOption"newest"Sort order: newest, oldest, highest, lowest, most_helpful
renderReview(review: Review, index: number) => ReactNodeCustom review renderer. When omitted, the default layout is used.
classNamestringCSS class name

Styling

[data-sr-review-list] { /* List container */ }
[data-sr-review] { /* Individual review article */ }
[data-sr-review-header] { /* Review header (rating + title) */ }
[data-sr-review-title] { /* Review title */ }
[data-sr-review-body] { /* Review body text */ }
[data-sr-review-meta] { /* Author, date, verified row */ }
[data-sr-review-author] { /* Author name */ }
[data-sr-review-verified] { /* Verified purchase badge */ }
[data-sr-review-date] { /* Review date */ }
[data-sr-review-photos] { /* Photo gallery container */ }
[data-sr-review-reply] { /* Merchant reply block */ }
[data-sr-review-reply-author] { /* Reply author name */ }
[data-sr-review-reply-body] { /* Reply text */ }
[data-sr-load-more] { /* Load more button */ }
[data-sr-loading] { /* Loading indicator */ }
[data-sr-empty] { /* Empty state */ }
[data-sr-error] { /* Error state */ }

ReviewCarousel

Horizontal carousel for browsing reviews with page-based navigation. Arrows and dots advance by a full page (the number of visible cards). Supports touch swipe, keyboard navigation (ArrowLeft/ArrowRight), and auto-play.

ReviewCarousel showing review cards with arrow and dot navigation
<ReviewCarousel productId="7654321098" visibleCount={3} />

With custom renderReview:

ReviewCarousel with custom purple gradient card rendering

Auto-play with custom rendering:

<ReviewCarousel
productId="7654321098"
autoPlay
autoPlayInterval={4000}
renderReview={(review) => (
<div key={review.id}>
<h3>{review.title}</h3>
<p>{review.body}</p>
</div>
)}
/>

Customized navigation:

<ReviewCarousel
productId="7654321098"
showDots={false}
prevIcon={<span></span>}
nextIcon={<span></span>}
/>

Dots only (no arrows):

<ReviewCarousel
productId="7654321098"
showArrows={false}
dotActiveColor="#2563eb"
dotInactiveColor="#e5e7eb"
/>

Props

PropTypeDefaultDescription
productIdstringShopify product ID (required)
perPagenumber10Number of reviews to fetch
visibleCountnumberresponsiveCards visible at once. When omitted, auto-calculates: 1 on mobile, 2 on tablet, 3 on desktop.
sortReviewSortOption"newest"Sort order
autoPlaybooleanfalseAuto-advance pages
autoPlayIntervalnumber5000Auto-play interval in ms. Pauses on hover.
renderReview(review: Review, index: number) => ReactNodeCustom review card renderer
classNamestringCSS class name
showArrowsbooleantrueShow prev/next arrow buttons
showDotsbooleantrueShow page dot indicators
dotActiveColorstring"currentColor"Color of the active page dot
dotInactiveColorstring"#d1d5db"Color of inactive page dots
prevIconReactNodeCustom content for the previous button
nextIconReactNodeCustom content for the next button

Styling

[data-sr-carousel] { /* Carousel container (focusable for keyboard nav) */ }
[data-sr-carousel-viewport] { /* Visible window (overflow: hidden) */ }
[data-sr-carousel-track] { /* Sliding strip of cards */ }
[data-sr-carousel-card] { /* Default review card */ }
[data-sr-carousel-prev] { /* Previous page button */ }
[data-sr-carousel-next] { /* Next page button */ }
[data-sr-carousel-prev]:disabled { /* Disabled state (first page) */ }
[data-sr-carousel-next]:disabled { /* Disabled state (last page) */ }
[data-sr-carousel-dots] { /* Dot container */ }
[data-sr-carousel-dot] { /* Individual dot */ }
[data-sr-carousel-dot][data-sr-active] { /* Active page dot */ }
[data-sr-empty] { /* Empty state */ }
[data-sr-error] { /* Error state */ }

ReviewBadge

Compact rating badge showing the aggregate rating and review count. Returns null while loading or when a product has 0 reviews.

ReviewBadge showing display-only and interactive star badges
  • Stars mode: shows star display and count. Interactive mode has clickable stars.
  • Thumbs mode: shows thumb icon + “X% recommend (N)”. Interactive mode has two thumb buttons.
{/* Display-only — click scrolls to #simplerreviews */}
<ReviewBadge productId="7654321098" />
{/* Custom click handler */}
<ReviewBadge productId="7654321098" onClick={() => scrollToReviews()} />
{/* Interactive — stars/thumbs are clickable */}
<ReviewBadge
productId="7654321098"
interactive
onRate={(rating) => submitRating(rating)}
/>

Props

PropTypeDefaultDescription
productIdstringShopify product ID (required)
onClick() => voidscroll to #simplerreviewsCalled on click
onRate(rating: number) => voidCalled with the rating value in interactive mode
interactivebooleanfalseMakes individual stars/thumbs clickable
starSizenumber16Icon size in pixels
classNamestringCSS class name

Styling

[data-sr-badge] { /* Badge container */ }
[data-sr-badge-interactive] { /* Interactive variant */ }
[data-sr-badge-thumbs] { /* Thumbs mode variant */ }
[data-sr-badge-count] { /* Review count text */ }

ReviewForm

Review submission form. Automatically detects the shop’s rating type and renders the appropriate input — a 5-star picker for stars mode, or recommend/don’t recommend buttons for thumbs mode.

ReviewForm showing stars mode and thumbs mode side by side
<ReviewForm
productId="7654321098"
onSuccess={(review) => console.log('Submitted!', review)}
/>

With visible thumb labels (icon-only by default in thumbs mode):

<ReviewForm
productId="7654321098"
thumbsUpLabel="Recommend"
thumbsDownLabel="Don't recommend"
/>

Text-only form (no rating input):

<ReviewForm
productId="7654321098"
showRating={false}
onSuccess={(review) => console.log('Submitted!', review)}
/>

Props

PropTypeDefaultDescription
productIdstringShopify product ID (required)
onSubmit(data: SubmitReviewData) => voidCalled when the form is submitted (before API call)
onSuccess(review: Review) => voidCalled after a successful submission
showRatingbooleantrueShow the rating input (stars or thumbs). Set to false for text-only forms (testimonials, feedback, Q&A).
maxPhotosnumber5Maximum number of photos allowed. Set to 0 to hide the upload field.
thumbsUpLabelstringVisible text label next to the thumbs-up button. Omit for icon-only.
thumbsDownLabelstringVisible text label next to the thumbs-down button. Omit for icon-only.
classNamestringCSS class name

Styling

[data-sr-form] { /* Form container */ }
[data-sr-form-field] { /* Individual form field wrapper */ }
[data-sr-form-label] { /* Field label */ }
[data-sr-form-input] { /* Text input */ }
[data-sr-form-textarea] { /* Textarea input */ }
[data-sr-form-submit] { /* Submit button */ }
[data-sr-form-error] { /* Error message */ }
[data-sr-form-success] { /* Success message */ }

ReviewFilters

Sort and filter controls. Adapts to the shop’s rating type — in thumbs mode, shows “All / Thumbs Up / Thumbs Down” instead of star-based filter options.

<ReviewFilters
ratingType="stars"
onSortChange={(sort) => setSort(sort)}
onRatingFilter={(rating) => setRating(rating)}
/>

Custom sort control:

<ReviewFilters
onSortChange={setSort}
renderSortControl={({ value, onChange, options }) => (
<select value={value} onChange={(e) => onChange(e.target.value)}>
{options.map((opt) => (
<option key={opt.value} value={opt.value}>{opt.label}</option>
))}
</select>
)}
/>

Props

PropTypeDefaultDescription
ratingType"stars" | "thumbs"Adapts filter labels to rating type
onSortChange(sort: ReviewSortOption) => voidCalled when sort changes
onRatingFilter(rating: number | null) => voidCalled when rating filter changes (null = show all)
renderSortControl(props) => ReactNodeCustom sort dropdown renderer
classNamestringCSS class name

Styling

[data-sr-filters] { /* Filters container */ }
[data-sr-filters-sort] { /* Sort control */ }
[data-sr-filters-rating] { /* Rating filter buttons */ }

ReviewPhotos

Photo grid with lightbox overlay.

<ReviewPhotos photos={['url1.jpg', 'url2.jpg']} />

Props

PropTypeDefaultDescription
photosstring[]Array of photo URLs (required)
classNamestringCSS class name

Styling

[data-sr-photos] { /* Photo grid container */ }
[data-sr-photo] { /* Individual photo thumbnail */ }
[data-sr-lightbox] { /* Lightbox overlay */ }
[data-sr-lightbox-image] { /* Lightbox full-size image */ }

ReviewStars

Pure display component for star ratings. Does not fetch data — just renders stars.

<ReviewStars rating={4.5} size={20} color="#FFB800" />

Props

PropTypeDefaultDescription
ratingnumberRating value (1-5, supports decimals for partial stars)
sizenumber20Star size in pixels
colorstring"currentColor"Star fill color
classNamestringCSS class name

Styling

[data-sr-stars] { /* Stars container */ }

ReviewThumbs

Pure display component for thumbs up/down icons. Supports custom colors, custom icons (any ReactNode), and custom aria labels. All data-connected components (summary, carousel, list, badge) automatically adapt to thumbs mode.

Thumbs mode showcase: icons, custom colors, sizes, badge, summary, and carousel
{/* Defaults */}
<ReviewThumbs isPositive={true} />
<ReviewThumbs isPositive={false} />
{/* Custom colors */}
<ReviewThumbs isPositive={true} positiveColor="#16a34a" />
<ReviewThumbs isPositive={false} negativeColor="#dc2626" />
{/* Custom icons */}
<ReviewThumbs isPositive={true} positiveIcon={<span>👍</span>} />
{/* Custom aria labels */}
<ReviewThumbs isPositive={true} positiveLabel="Recommended" />

Props

PropTypeDefaultDescription
isPositivebooleantrue for thumbs up, false for thumbs down (required)
sizenumber20Icon size in pixels
positiveColorstring"currentColor"Color when isPositive is true
negativeColorstring"currentColor"Color when isPositive is false
positiveIconReactNodeCustom icon for thumbs up (replaces default SVG)
negativeIconReactNodeCustom icon for thumbs down (replaces default SVG)
positiveLabelstring"Thumbs up"Aria label for thumbs up
negativeLabelstring"Thumbs down"Aria label for thumbs down
classNamestringCSS class name

Styling

[data-sr-thumbs] { /* Thumb container */ }
[data-sr-thumbs-positive] { /* Thumbs up variant */ }
[data-sr-thumbs-negative] { /* Thumbs down variant */ }

ReviewRating

Auto-selecting wrapper that renders <ReviewStars> for stars mode or <ReviewThumbs> for thumbs mode. Useful when building custom review layouts where you don’t want to check the rating type yourself.

<ReviewRating rating={review.rating} ratingType={ratingType} size={16} />

Props

PropTypeDefaultDescription
ratingnumberThe rating value (1-5 for stars, 0 or 1 for thumbs)
ratingType"stars" | "thumbs"Which display mode to use
sizenumber20Icon size in pixels
classNamestringCSS class name