Review Masonry 1
Review masonry: a dark summary rail computes the average, star breakdown and count from the supplied reviews only, beside a light masonry wall the visitor filters with a FLIP shuffle. One question-and-answer action closes the section.
Use it in a prompt
Use proof/review-masonry from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/proof/review-masonry.tsx. - Import it and pass your copy and images (Props tab):
import { ReviewMasonry } from "@/components/funneldna/proof/review-masonry"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/proof/review-masonry/component.tsx 559 lines
// layout: split-contrast
// Review masonry: a dark summary rail computes the average, star breakdown and count from the supplied reviews only, beside a light masonry wall the visitor filters with a FLIP shuffle. One question-and-answer action closes the section.
import React, { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { Camera, Check, Star } from 'lucide-react';
import type { LucideIcon } from 'lucide-react';
import { Backdrop, Divider, FX_HOST } from '../fx/fx';
import tabletop from '../fx/backdrops/tabletop';
export type ReviewMasonryReview = {
id?: string;
rating: number; // 1 to 5; a review without a valid rating is ignored
title?: string; // bold one-line title
body?: string;
name?: string;
detail?: string; // location or product, shown under the name
date?: string;
photo?: string; // reviewer photo src
photoAlt?: string;
avatar?: string; // reviewer avatar src; initials are used when absent
verified?: boolean; // 'Verified purchase' shows only when this is true
};
export type ReviewMasonryCopy = {
sectionLabel?: string; // accessible name when no headline is supplied
filtersLabel?: string;
filterAll?: string;
filterFive?: string;
filterPhotos?: string;
reviewSingular?: string;
reviewPlural?: string;
basedOn?: string; // placeholders: {count}, {noun}
averageLabel?: string; // placeholder: {rating}
distributionLabel?: string;
barLabel?: string; // placeholders: {stars}, {count}
statusAll?: string; // placeholders: {total}, {noun}
statusFiltered?: string; // placeholders: {shown}, {total}, {noun}
rated?: string; // placeholder: {rating}
readMore?: string;
readLess?: string;
verified?: string;
photoAlt?: string; // placeholder: {name}
photoAltAnon?: string;
};
export type ReviewMasonryProps = {
// Every proof value comes from here. Empty (the default) renders nothing.
reviews?: ReviewMasonryReview[];
headline?: React.ReactNode;
lead?: React.ReactNode;
ask?: string; // the question the button answers
actionLabel?: string; // empty hides the action
actionNote?: string; // one short reassurance line under the button
href?: string;
onAction?: () => void;
backdropImage?: string; // an fx backdrop asset; the page scene slot replaces it
copy?: ReviewMasonryCopy;
state?: 'default' | 'hover' | 'active' | 'disabled';
className?: string;
};
type Filter = 'all' | 'five' | 'photos';
const DEFAULT_COPY: Required<ReviewMasonryCopy> = {
sectionLabel: 'Customer reviews',
filtersLabel: 'Filter reviews',
filterAll: 'All',
filterFive: '5 stars',
filterPhotos: 'With photos',
reviewSingular: 'review',
reviewPlural: 'reviews',
basedOn: 'Based on {count} {noun}',
averageLabel: 'Average rating {rating} out of 5',
distributionLabel: 'Rating breakdown',
barLabel: '{stars} star: {count}',
statusAll: 'Showing all {total} {noun}',
statusFiltered: 'Showing {shown} of {total} {noun}',
rated: 'Rated {rating} out of 5',
readMore: 'Read more',
readLess: 'Show less',
verified: 'Verified purchase',
photoAlt: 'Photo shared by {name}',
photoAltAnon: 'Photo shared with this review',
};
export function ReviewMasonry(props: ReviewMasonryProps) {
const {
reviews = [],
headline = 'Don’t take our word for it. Read theirs.',
lead = '',
ask = 'Ready to try it for yourself?',
actionLabel = 'Yes, I’m ready for mine',
actionNote = '',
href,
onAction,
backdropImage = tabletop,
copy,
state = 'default',
className = '',
} = props;
const c: Required<ReviewMasonryCopy> = { ...DEFAULT_COPY };
if (copy) {
(Object.keys(copy) as (keyof ReviewMasonryCopy)[]).forEach((k) => {
const v = copy[k];
if (typeof v === 'string') c[k] = v;
});
}
const uid = useId();
const headingId = `${uid}-heading`;
const [filter, setFilter] = useState<Filter>('all');
const [expanded, setExpanded] = useState<Record<string, boolean>>({});
const [clampable, setClampable] = useState<Record<string, boolean>>({});
const [touched, setTouched] = useState(false);
const [reduced, setReduced] = useState(false);
const gridRef = useRef<HTMLDivElement | null>(null);
const itemEls = useRef(new Map<string, HTMLElement>());
const bodyEls = useRef(new Map<string, HTMLElement>());
const snap = useRef<Map<string, DOMRect> | null>(null);
const expandedRef = useRef(expanded);
expandedRef.current = expanded;
const list = useMemo(
() =>
(Array.isArray(reviews) ? reviews : [])
.filter((r) => r && typeof r.rating === 'number' && Number.isFinite(r.rating) && r.rating >= 1 && r.rating <= 5)
.map((r, i) => ({ ...r, key: r.id ? `id-${r.id}` : `review-${i}`, idx: i, stars: Math.round(r.rating) })),
[reviews],
);
const stats = useMemo(() => {
const total = list.length;
const sum = list.reduce((s, r) => s + r.rating, 0);
const dist = [5, 4, 3, 2, 1].map((s) => ({ stars: s, count: list.filter((r) => r.stars === s).length }));
return {
total,
average: total ? sum / total : 0,
dist,
five: dist[0].count,
photos: list.filter((r) => Boolean(r.photo)).length,
};
}, [list]);
const counts: Record<Filter, number> = { all: stats.total, five: stats.five, photos: stats.photos };
const active: Filter = counts[filter] > 0 ? filter : 'all';
const visible = list.filter((r) => (active === 'all' ? true : active === 'five' ? r.stars === 5 : Boolean(r.photo)));
useEffect(() => {
if (typeof window === 'undefined' || !window.matchMedia) return;
const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
const on = () => setReduced(mq.matches);
on();
mq.addEventListener('change', on);
return () => mq.removeEventListener('change', on);
}, []);
// FLIP: cards that stay glide from their old spot; cards that arrive pop in.
useLayoutEffect(() => {
const before = snap.current;
if (!before) return;
snap.current = null;
itemEls.current.forEach((el, k) => {
if (typeof el.animate !== 'function') return;
const a = before.get(k);
const b = el.getBoundingClientRect();
if (a) {
const dx = a.left - b.left;
const dy = a.top - b.top;
if (Math.abs(dx) < 1 && Math.abs(dy) < 1) return;
el.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'translate(0px, 0px)' }], {
duration: 360,
easing: 'cubic-bezier(.2,.7,.2,1)',
});
} else {
el.animate([{ opacity: 0.4, transform: 'scale(0.94)' }, { opacity: 1, transform: 'scale(1)' }], {
duration: 300,
easing: 'cubic-bezier(.2,.7,.2,1)',
});
}
});
}, [filter, expanded]);
const measure = useCallback(() => {
setClampable((prev) => {
let changed = false;
const next: Record<string, boolean> = {};
bodyEls.current.forEach((el, k) => {
const v = expandedRef.current[k] ? prev[k] ?? true : el.scrollHeight - el.clientHeight > 2;
next[k] = v;
if (prev[k] !== v) changed = true;
});
if (Object.keys(prev).length !== Object.keys(next).length) changed = true;
return changed ? next : prev;
});
}, []);
useLayoutEffect(() => {
measure();
}, [measure, list, filter, expanded]);
const hasReviews = stats.total > 0;
useEffect(() => {
const el = gridRef.current;
if (!el || typeof ResizeObserver === 'undefined') return;
const ro = new ResizeObserver(() => measure());
ro.observe(el);
return () => ro.disconnect();
}, [measure, hasReviews]);
if (!hasReviews) return null;
const takeSnapshot = () => {
if (reduced) return;
const m = new Map<string, DOMRect>();
itemEls.current.forEach((el, k) => m.set(k, el.getBoundingClientRect()));
snap.current = m;
};
const choose = (f: Filter) => {
if (counts[f] === 0 || f === active) return;
takeSnapshot();
setTouched(true);
setFilter(f);
};
const toggle = (k: string) => {
takeSnapshot();
setTouched(true);
setExpanded((prev) => ({ ...prev, [k]: !prev[k] }));
};
const noun = (n: number) => (n === 1 ? c.reviewSingular : c.reviewPlural);
const avgText = stats.average.toFixed(1);
const status =
active === 'all'
? fmt(c.statusAll, { total: stats.total, noun: noun(stats.total) })
: fmt(c.statusFiltered, { shown: visible.length, total: stats.total, noun: noun(stats.total) });
const chips: { key: Filter; label: string; icon: LucideIcon | null }[] = [
{ key: 'all', label: c.filterAll, icon: null },
{ key: 'five', label: c.filterFive, icon: Star },
{ key: 'photos', label: c.filterPhotos, icon: Camera },
];
const disabled = state === 'disabled';
const showClose = Boolean(actionLabel);
const renderClose = (where: 'rail' | 'foot') => (
<div className={`cf-rm__close is-${where}`}>
{ask ? <p className='cf-rm__ask'>{ask}</p> : null}
{href && !disabled ? (
<a className='cf-rm__btn' href={href} onClick={onAction ? () => onAction() : undefined}>
{actionLabel}
</a>
) : (
<button type='button' className='cf-rm__btn' disabled={disabled} onClick={() => onAction?.()}>
{actionLabel}
</button>
)}
{actionNote ? <p className='cf-rm__note'>{actionNote}</p> : null}
</div>
);
const rootClass = ['cf-rm', touched ? '' : 'is-intro', state !== 'default' ? `cf-rm--${state}` : '', className]
.filter(Boolean)
.join(' ');
return (
<section className={rootClass} aria-labelledby={headline ? headingId : undefined} aria-label={headline ? undefined : c.sectionLabel}>
<style>{CSS}</style>
<div className='cf-rm__wrap'>
<div className='cf-rm__rail-col'>
<div className='cf-rm__stage' aria-hidden='true'>
<div className='cf-rm__fx' style={FX_HOST}>
<Backdrop src={backdropImage} treatment='scrim-dark' position='center' />
<div className='cf-rm__edge'>
<Divider shape='step' tone='surface' height={40} />
</div>
</div>
</div>
<div className='cf-rm__rail'>
{headline ? (
<h2 id={headingId} className='cf-rm__h2'>
{headline}
</h2>
) : null}
{lead ? <p className='cf-rm__lead'>{lead}</p> : null}
<div className='cf-rm__score'>
<div className='cf-rm__avg'>
<span className='cf-rm__num' aria-hidden='true'>
{avgText}
</span>
<span className='cf-rm__sr'>{fmt(c.averageLabel, { rating: avgText })}</span>
<Stars value={stats.average} size={18} />
<p className='cf-rm__based'>{fmt(c.basedOn, { count: stats.total, noun: noun(stats.total) })}</p>
</div>
<ul className='cf-rm__bars' aria-label={c.distributionLabel}>
{stats.dist.map((d) => {
const pct = stats.total ? Math.round((d.count / stats.total) * 100) : 0;
return (
<li key={d.stars} className='cf-rm__bar'>
<span className='cf-rm__sr'>{fmt(c.barLabel, { stars: d.stars, count: d.count })}</span>
<span className='cf-rm__bar-label' aria-hidden='true'>
{d.stars}
<Star size={16} strokeWidth={1.5} fill='currentColor' />
</span>
<span className='cf-rm__track' aria-hidden='true'>
<span className='cf-rm__fill' style={{ width: `${pct}%` }} />
</span>
<span className='cf-rm__bar-count' aria-hidden='true'>
{d.count}
</span>
</li>
);
})}
</ul>
</div>
<div className='cf-rm__chips' role='group' aria-label={c.filtersLabel}>
{chips.map((ch) => {
const Icon = ch.icon;
return (
<button
key={ch.key}
type='button'
className='cf-rm__chip'
aria-pressed={active === ch.key}
disabled={counts[ch.key] === 0}
onClick={() => choose(ch.key)}
>
{Icon ? <Icon size={16} strokeWidth={2.5} aria-hidden='true' /> : null}
<span>{ch.label}</span>
<span className='cf-rm__chip-count'>{counts[ch.key]}</span>
</button>
);
})}
</div>
{showClose ? renderClose('rail') : null}
</div>
</div>
<div className='cf-rm__board'>
<p className='cf-rm__status' aria-live='polite'>
{status}
</p>
<div className='cf-rm__grid' ref={gridRef}>
{visible.map((r, i) => {
const isOpen = Boolean(expanded[r.key]);
const canClamp = Boolean(clampable[r.key]) || isOpen;
const bodyId = `${uid}-body-${r.idx}`;
const showWho = Boolean(r.name || r.detail || r.verified === true);
return (
<article
key={r.key}
className='cf-rm__card'
ref={(el) => {
if (el) itemEls.current.set(r.key, el);
else itemEls.current.delete(r.key);
}}
style={{ ['--rm-delay' as string]: `${Math.min(i * 0.07, 0.28)}s` } as React.CSSProperties}
>
<div className='cf-rm__meta'>
<Stars value={r.rating} size={16} />
<span className='cf-rm__sr'>{fmt(c.rated, { rating: r.rating })}</span>
{r.date ? <span className='cf-rm__date'>{r.date}</span> : null}
</div>
{r.title ? <h3 className='cf-rm__title'>{r.title}</h3> : null}
{r.body ? (
<>
<p
id={bodyId}
className={`cf-rm__body${isOpen ? '' : ' is-clamped'}`}
ref={(el) => {
if (el) bodyEls.current.set(r.key, el);
else bodyEls.current.delete(r.key);
}}
>
{r.body}
</p>
{canClamp ? (
<button type='button' className='cf-rm__more' aria-expanded={isOpen} aria-controls={bodyId} onClick={() => toggle(r.key)}>
{isOpen ? c.readLess : c.readMore}
</button>
) : null}
</>
) : null}
{r.photo ? (
<img
className='cf-rm__photo'
src={r.photo}
alt={r.photoAlt || (r.name ? fmt(c.photoAlt, { name: r.name }) : c.photoAltAnon)}
width={800}
height={600}
loading='lazy'
decoding='async'
/>
) : null}
{showWho ? (
<div className='cf-rm__who'>
{r.avatar ? (
<img className='cf-rm__avatar' src={r.avatar} alt='' width={40} height={40} loading='lazy' />
) : r.name ? (
<span className='cf-rm__avatar cf-rm__initials' aria-hidden='true'>
{initials(r.name)}
</span>
) : null}
<div className='cf-rm__who-text'>
{r.name ? <span className='cf-rm__name'>{r.name}</span> : null}
{r.detail ? <span className='cf-rm__detail'>{r.detail}</span> : null}
{r.verified === true ? (
<span className='cf-rm__verified'>
<span className='cf-rm__tick' aria-hidden='true'>
<Check size={12} strokeWidth={3} />
</span>
{c.verified}
</span>
) : null}
</div>
</div>
) : null}
</article>
);
})}
</div>
{showClose ? renderClose('foot') : null}
</div>
</div>
</section>
);
}
export default ReviewMasonry;
function Stars({ value, size }: { value: number; size: number }) {
const pct = Math.max(0, Math.min(100, (value / 5) * 100));
const row = [0, 1, 2, 3, 4].map((i) => <Star key={i} strokeWidth={1.5} fill='currentColor' />);
return (
<span className='cf-rm__stars' aria-hidden='true' style={{ ['--rm-ss' as string]: `${size}px` } as React.CSSProperties}>
<span className='cf-rm__stars-row is-base'>{row}</span>
<span className='cf-rm__stars-row is-fill' style={{ width: `${pct}%` }}>
{row}
</span>
</span>
);
}
function fmt(template: string, vars: Record<string, string | number>) {
return Object.keys(vars).reduce((out, k) => out.split('{' + k + '}').join(String(vars[k])), template);
}
function initials(name: string) {
return name
.split(' ')
.filter(Boolean)
.slice(0, 2)
.map((w) => w.charAt(0).toUpperCase())
.join('');
}
const CSS = `
.cf-rm{--rm-gutter:clamp(16px,5vw,48px);--rm-max:1120px;--rm-rail:clamp(320px,30vw,380px);--rm-gap:clamp(40px,4.5vw,64px);--rm-edge:40px;--rm-star:var(--accent-fill,var(--accent));--rm-shadow:var(--shadow,oklch(0.22 0.03 260));position:relative;isolation:isolate;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:0 var(--rm-gutter) clamp(64px,8.5vw,120px)}
.cf-rm *,.cf-rm *::before,.cf-rm *::after{box-sizing:border-box}
.cf-rm__wrap{max-width:var(--rm-max);margin:0 auto}
.cf-rm__rail-col{position:relative;padding:40px 0 calc(32px + var(--rm-edge));margin-bottom:28px;background:var(--band);color:var(--band-ink)}
.cf-rm__stage{position:absolute;z-index:0;top:0;bottom:0;left:calc(-1 * var(--rm-gutter));right:calc(-1 * var(--rm-gutter));background:var(--band);overflow:hidden;pointer-events:none}
.cf-rm__rail{position:relative;z-index:1;color:var(--band-ink)}
.cf-rm__fx{width:100%;height:100%}
.cf-rm__edge{position:absolute;left:0;right:0;bottom:0;height:var(--rm-edge)}
.cf-rm__h2{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,2.8vw,2.5rem);line-height:1.06;text-wrap:balance;color:var(--band-ink)}
.cf-rm__lead{display:none;margin:14px 0 0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-weight:500;text-wrap:pretty;color:var(--band-ink)}
.cf-rm__score{margin-top:24px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:20px;align-items:start}
.cf-rm__avg{min-width:7rem;max-width:9rem}
.cf-rm__num{display:block;font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-rm__avg .cf-rm__stars{margin-top:12px}
.cf-rm__based{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-rm__bars{list-style:none;margin:2px 0 0;padding:0;display:grid;gap:7px}
.cf-rm__bar{display:grid;grid-template-columns:2.1rem minmax(0,1fr) 1.75rem;align-items:center;gap:10px;font-size:.9375rem;line-height:1.2;font-weight:700;font-variant-numeric:tabular-nums}
.cf-rm__bar-label{display:inline-flex;align-items:center;gap:3px}
.cf-rm__bar-label svg{flex:0 0 auto}
.cf-rm__track{display:block;height:8px;border-radius:999px;background:oklch(from var(--band-ink) l c h / 0.2);overflow:hidden}
.cf-rm__fill{display:block;height:100%;border-radius:inherit;background:var(--band-ink)}
.cf-rm__bar-count{text-align:right}
.cf-rm__chips{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0 0;padding:0}
.cf-rm__chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid oklch(from var(--band-ink) l c h / 0.24);background:oklch(from var(--band-ink) l c h / 0.12);color:var(--band-ink);font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1;white-space:nowrap;cursor:pointer;transition:background .16s ease,color .16s ease,transform .16s ease}
.cf-rm__chip-count{font-weight:600;font-variant-numeric:tabular-nums}
.cf-rm__chip:hover:not(:disabled){background:oklch(from var(--band-ink) l c h / 0.2)}
.cf-rm__chip:active:not(:disabled){transform:scale(0.97)}
.cf-rm__chip[aria-pressed=true]{background:var(--band-ink);color:var(--band);border-color:var(--band-ink)}
.cf-rm__chip:focus-visible{outline:3px solid var(--band-ink);outline-offset:2px}
.cf-rm__chip:disabled{opacity:.45;cursor:not-allowed}
.cf-rm__close{margin-top:36px}
.cf-rm__close.is-rail{display:none}
.cf-rm__close.is-foot{max-width:30rem;margin:12px auto 0;text-align:center}
.cf-rm__ask{margin:0 0 16px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance}
.is-rail .cf-rm__ask{color:var(--band-ink)}
.is-foot .cf-rm__ask{color:var(--ink)}
.cf-rm__note{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;text-align:center;text-wrap:pretty}
.is-rail .cf-rm__note{color:var(--band-ink)}
.is-foot .cf-rm__note{color:var(--muted)}
.cf-rm__btn{--rm-bg:var(--button-bg,var(--cta));--rm-bg2:var(--button-bg-2,var(--cta-2));display:flex;align-items:center;justify-content:center;width:100%;min-height:64px;padding:12px 24px;border:0;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.4vw,1.25rem);line-height:1.15;text-align:center;text-wrap:balance;text-decoration:none;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--rm-bg) calc(l + 0.04) c h),oklch(from var(--rm-bg2) calc(l - 0.02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rm-bg) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--rm-bg) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rm-shadow) l c h / 0.3),0 8px 16px -6px oklch(from var(--rm-shadow) l c h / 0.45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-rm__btn:hover:not(:disabled),.cf-rm--hover .cf-rm__btn:not(:disabled){background:linear-gradient(oklch(from var(--rm-bg) calc(l - 0.01) c h),oklch(from var(--rm-bg2) calc(l - 0.07) c h));box-shadow:inset 0 1px 0 oklch(from var(--rm-bg) calc(l + 0.1) c h / 0.6),inset 0 -3px 0 oklch(from var(--rm-bg) calc(l - 0.2) c h),0 1px 2px oklch(from var(--rm-shadow) l c h / 0.32),0 10px 20px -6px oklch(from var(--rm-shadow) l c h / 0.5);transform:translateY(-1px)}
.cf-rm__btn:active:not(:disabled),.cf-rm--active .cf-rm__btn:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--rm-bg) calc(l - 0.04) c h),oklch(from var(--rm-bg2) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--rm-shadow) l c h / 0.35),inset 0 -2px 0 oklch(from var(--rm-bg) calc(l - 0.2) c h),0 1px 1px oklch(from var(--rm-shadow) l c h / 0.3)}
.cf-rm__btn:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.is-foot .cf-rm__btn:focus-visible{outline-color:var(--field-focus,var(--accent))}
.cf-rm__btn:disabled{cursor:not-allowed;background:var(--secondary);color:color-mix(in oklch,var(--secondary-ink) 70%,var(--secondary));text-shadow:none;box-shadow:none;transform:none}
.cf-rm__board{min-width:0}
.cf-rm__status{margin:0 0 16px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-rm__grid{columns:300px 2;column-gap:20px}
.cf-rm__card{display:block;break-inside:avoid;margin:0 0 20px;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(from var(--rm-shadow) l c h / 0.22),0 4px 10px -2px oklch(from var(--rm-shadow) l c h / 0.2)));padding:clamp(20px,2.4vw,24px)}
.cf-rm__meta{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cf-rm__date{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
.cf-rm__title{margin:12px 0 0;font-family:var(--font-display);font-weight:800;text-transform:var(--display-case,none);font-size:1.125rem;line-height:1.3;letter-spacing:-0.01em;text-wrap:balance;color:var(--ink)}
.cf-rm__body{margin:8px 0 0;font-size:1.0625rem;line-height:1.5;text-wrap:pretty;color:var(--ink)}
.cf-rm__body.is-clamped{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}
.cf-rm__more{display:flex;width:fit-content;align-items:center;justify-content:flex-start;text-align:left;min-height:44px;margin:0;padding:4px 0;border:0;background:none;font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1.4;color:var(--link,var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / 0.45);text-underline-offset:.18em;cursor:pointer;transition:color .16s ease}
.cf-rm__more:hover{color:oklch(from var(--link,var(--accent)) calc(l - 0.08) c h);text-decoration-color:currentColor}
.cf-rm__more:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.45);outline-offset:2px;border-radius:4px}
.cf-rm__photo{display:block;width:100%;height:auto;aspect-ratio:4 / 3;object-fit:cover;object-position:center;border-radius:10px;margin-top:16px}
.cf-rm__who{display:flex;align-items:flex-start;gap:12px;margin-top:16px}
.cf-rm__avatar{flex:0 0 40px;width:40px;height:40px;border-radius:999px;object-fit:cover}
.cf-rm__initials{display:inline-flex;align-items:center;justify-content:center;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1}
.cf-rm__who-text{min-width:0}
.cf-rm__name{display:block;font-size:1rem;line-height:1.3;font-weight:700;color:var(--ink)}
.cf-rm__detail{display:block;font-size:.9375rem;line-height:1.4;color:var(--muted)}
.cf-rm__verified{display:block;margin-top:4px;font-size:.875rem;line-height:1.3;font-weight:700;color:var(--success)}
.cf-rm__tick{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;background:var(--success);color:var(--card);vertical-align:-0.3em;margin-inline-end:.4em}
.cf-rm__stars{position:relative;display:inline-flex;vertical-align:middle;line-height:0}
.cf-rm__stars-row{display:inline-flex;gap:2px}
.cf-rm__stars-row svg{flex:0 0 auto;width:var(--rm-ss,16px);height:var(--rm-ss,16px)}
.cf-rm__stars-row.is-base{color:oklch(from var(--ink) l c h / 0.16)}
.cf-rm__stars-row.is-fill{position:absolute;top:0;bottom:0;left:0;overflow:hidden;white-space:nowrap;color:var(--rm-star)}
.cf-rm__rail .cf-rm__stars-row.is-base{color:oklch(from var(--band-ink) l c h / 0.3)}
.cf-rm__rail .cf-rm__stars-row.is-fill{color:var(--band-ink)}
.cf-rm__sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@keyframes cf-rm-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
.cf-rm.is-intro .cf-rm__card{animation:cf-rm-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--rm-delay,0s)}
@media (min-width:900px){
.cf-rm{padding-top:clamp(56px,8vw,112px)}
.cf-rm__wrap{display:grid;grid-template-columns:var(--rm-rail) minmax(0,1fr);column-gap:var(--rm-gap);align-items:stretch}
.cf-rm__rail-col{position:static;padding:0;margin:0;background:var(--band)}
.cf-rm__stage{top:0;bottom:0;left:0;right:auto;width:calc(max(var(--rm-gutter), (100% - var(--rm-max)) / 2) + var(--rm-rail) + var(--rm-gap) / 2)}
.cf-rm__edge{display:none}
.cf-rm__lead{display:block}
.cf-rm__score{margin-top:32px}
.cf-rm__chips{margin:28px 0 0}
.cf-rm__close.is-rail{display:block}
.cf-rm__close.is-foot{display:none}
}
@media (min-width:900px) and (min-height:760px){
.cf-rm__rail{position:sticky;top:32px}
}
@media (prefers-reduced-motion:reduce){
.cf-rm.is-intro .cf-rm__card{animation:none}
.cf-rm__btn,.cf-rm__chip,.cf-rm__more{transition:none}
.cf-rm__btn:hover:not(:disabled),.cf-rm__btn:active:not(:disabled),.cf-rm__chip:active:not(:disabled){transform:none}
}
`;
pieces/proof/review-masonry/specimen.tsx 133 lines
import __studioImage7b0eb3e2 from "../assets/1101ca6d4537b902.webp";
import __studioImage4f2c0e0d from "../assets/b97ef769d749b99c.webp";
import __studioImageee1f1f56 from "../assets/636ce6e783be0899.webp";
import { ReviewMasonry } from '../review-masonry';
import type { ReviewMasonryReview } from '../review-masonry';
import defaults from '../../studio-defaults.json';
export const states = ['default', 'hover', 'active', 'disabled'];
const platePhoto = __studioImage7b0eb3e2;
const mugPhoto = __studioImage4f2c0e0d;
const bowlPhoto = __studioImageee1f1f56;
const REVIEWS: ReviewMasonryReview[] = [
{
id: 'maren',
rating: 5,
title: 'We use them three meals a day',
body: 'Bought the four-place setting in March. Eight months of dishwasher runs and toddler drops on a tile floor, and not one chip. The oatmeal glaze still looks hand-finished up close.',
name: 'Maren T.',
detail: 'Duluth, MN',
date: 'Nov 2026',
photo: platePhoto,
photoAlt: 'Speckled oatmeal stoneware plate with roasted carrots on an oak table',
verified: true,
},
{
id: 'owen',
rating: 5,
title: 'The mug I reach for first',
body: 'Heavy in the right way. Keeps my coffee warm through the first two emails of the day.',
name: 'Owen P.',
detail: 'Asheville, NC',
date: 'Oct 2026',
photo: mugPhoto,
photoAlt: 'Sage-green stoneware mug of coffee held in two hands',
verified: true,
},
{
id: 'priya',
rating: 4,
title: 'Beautiful, a little heavy to stack',
body: 'The speckle on the bowls is gorgeous and every piece is slightly different, which is exactly why I ordered from a small studio. My only note: a stack of eight dinner plates is heavy for my top shelf, so they live on the counter rack now. Worth it, but plan your cupboard space before you order the full set.',
name: 'Priya S.',
detail: 'Madison, WI',
date: 'Oct 2026',
verified: true,
},
{
id: 'jonah',
rating: 5,
title: 'A gift that got a thank-you card',
body: 'Sent the serving bowl to my sister for her new apartment. It arrived double-boxed and she wrote me an actual paper card about it.',
name: 'Jonah L.',
detail: 'Portland, OR',
date: 'Sep 2026',
},
{
id: 'ellie',
rating: 5,
title: 'Pasta bowls at the perfect depth',
body: 'Deep enough for soup, wide enough for pasta, and they still fit under my faucet. I’ve ordered a second set in charcoal for the cabin.',
name: 'Ellie R.',
detail: 'Burlington, VT',
date: 'Sep 2026',
photo: bowlPhoto,
photoAlt: 'Stack of charcoal and cream stoneware pasta bowls on a kitchen shelf',
verified: true,
},
{
id: 'marcus',
rating: 3,
title: 'Lovely, but order early',
body: 'The pieces are lovely and the glaze matches the photos. Shipping took almost three weeks because each batch is fired to order, which the site does mention. I just missed it. If you need them for a date, order well ahead.',
name: 'Marcus D.',
detail: 'Tulsa, OK',
date: 'Aug 2026',
verified: true,
},
{
id: 'hana',
rating: 5,
title: 'Microwave and oven, no drama',
body: 'Reheated, baked and broiled in these. No crazing, no scorching-hot rims.',
name: 'Hana K.',
detail: 'Sacramento, CA',
date: 'Aug 2026',
},
{
id: 'theo',
rating: 4,
title: 'I want more colours',
body: 'I love the sage and the oatmeal. I’d buy a deep blue in a heartbeat if they ever glaze one.',
name: 'Theo B.',
detail: 'Ann Arbor, MI',
date: 'Jul 2026',
verified: true,
},
{
id: 'rosa',
rating: 5,
title: 'Our table finally looks finished',
body: 'We’d been eating off mismatched registry plates for ten years. The Fernhollow set made the whole kitchen feel calmer, and I didn’t expect a set of dishes to do that. Guests ask where they’re from every single time they come over.',
name: 'Rosa M.',
detail: 'Santa Fe, NM',
date: 'Jul 2026',
verified: true,
},
{
id: 'ben',
rating: 5,
title: 'Sturdy enough for two kids',
body: 'Two kids under six, zero breaks so far. The matte finish doesn’t show fingerprints either.',
name: 'Ben A.',
detail: 'Columbus, OH',
date: 'Jun 2026',
},
];
export default function ReviewMasonrySpecimen({ state = 'default' }: { state?: 'default' | 'hover' | 'active' | 'disabled' }) {
return (
<ReviewMasonry
reviews={REVIEWS}
headline='Real Fernhollow tables. Real reviews.'
lead='Hand-thrown stoneware, fired in small batches. Read every review, the 3-star one too.'
ask='Ready to set a table like theirs?'
actionLabel='Yes, I’m ready to set mine'
actionNote={defaults.sample.guarantee}
onAction={() => {}}
state={state}
/>
);
}
| Name | Type | Details |
|---|---|---|
reviews OptionalReviewMasonry |
ReviewMasonryReview[] |
|
headline OptionalReviewMasonry |
React.ReactNode |
|
lead OptionalReviewMasonry |
React.ReactNode |
|
ask OptionalReviewMasonry |
string |
|
actionLabel OptionalReviewMasonry |
string |
|
actionNote OptionalReviewMasonry |
string |
|
href OptionalReviewMasonry |
string |
|
onAction OptionalReviewMasonry |
() => void |
|
backdropImage OptionalReviewMasonry |
string |
|
copy OptionalReviewMasonry |
ReviewMasonryCopy |
|
state OptionalReviewMasonry |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalReviewMasonry |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
1101ca6d4537b902.webp
image/webp · 133 KB
-
636ce6e783be0899.webp
image/webp · 48.3 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
b97ef769d749b99c.webp
image/webp · 29.4 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e0015f5afe2d03e2.webp
image/webp · 29.5 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB