Rating Halo 1
Rating halo: the rating set as one big scoreboard line on a dark photo stage, review tiles drifting around a tall
Use it in a prompt
Use proof/rating-halo 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/rating-halo.tsx. - Import it and pass your copy and images (Props tab):
import { RatingHalo } from "@/components/funneldna/proof/rating-halo"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/proof/rating-halo/component.tsx 410 lines
// layout: fact-scoreboard
// Rating halo: the rating set as one big scoreboard line on a dark photo stage, review tiles drifting around a tall
// in-use photo that overhangs the stage edge, then the cart action and the press row. Fast proof right before the ask.
import * as React from "react";
import { ShieldCheck, ShoppingCart, Star } from "lucide-react";
import { motion, useReducedMotion, useScroll, useTransform } from "motion/react";
import { Backdrop, FX_HOST } from "../fx/fx";
import home from "../fx/backdrops/home";
export type RatingHaloReview = {
title?: string;
text: string;
name: string;
date?: string;
/** 1–5; omit to hide the stars on this card */
rating?: number;
};
export type RatingHaloPress = {
name: string;
/** optional wordmark image; without it the name is set as a type wordmark */
logo?: string;
};
export type RatingHaloProps = {
/** average rating exactly as supplied, e.g. "4.8"; empty uses the fallback headline */
rating?: string;
/** number of ratings exactly as supplied, e.g. "12,400" */
ratingCount?: string;
/** headline when rating and count are supplied; placeholders {rating} {stars} {count} */
ratingHeadline?: string;
/** headline when only the rating is supplied; placeholders {rating} {stars} */
ratingHeadlineNoCount?: string;
/** headline used when no rating is supplied */
headline?: React.ReactNode;
/** source line under the headline */
source?: React.ReactNode;
reviews?: RatingHaloReview[];
/** scene slot: a person using the product */
photoImage?: string;
photoAlt?: string;
photoCaption?: string;
/** fx backdrop module behind the headline stage (imported asset URL) */
backdropImage?: string;
/** one-sentence lines above the action; a single-word last line is set large */
punch?: string[];
actionLabel?: string;
price?: string;
actionNote?: string;
href?: string;
onAction?: () => void;
actionDisabled?: boolean;
pressLabel?: string;
press?: RatingHaloPress[];
/** review columns drift in opposite directions on scroll (always off under reduced motion) */
drift?: boolean;
/** how many reviews the phone layout stacks under the photo (fast proof, no sideways scroll) */
phoneReviews?: number;
state?: "default" | "hover";
/** accessible labels; {rating} is replaced in starsLabel */
copy?: { starsLabel?: string; outOfFive?: string; reviewsRegion?: string };
className?: string;
};
const COPY = {
starsLabel: "{rating} out of 5 stars",
outOfFive: "out of 5 stars",
reviewsRegion: "Customer reviews",
};
export function RatingHalo(props: RatingHaloProps) {
const {
rating = "",
ratingCount = "",
ratingHeadline = "{rating} {stars} from {count} ratings.",
ratingHeadlineNoCount = "Rated {rating} {stars} by the people who use it.",
headline = "Hear it from the people who use it",
source,
reviews = [],
photoImage,
photoAlt = "",
photoCaption = "",
backdropImage = home,
punch = [],
actionLabel = "Add To Cart",
price = "",
actionNote = "",
href,
onAction,
actionDisabled = false,
pressLabel = "As featured in",
press = [],
drift = true,
phoneReviews = 3,
state = "default",
copy,
className = "",
} = props;
const c = { ...COPY, ...copy };
const rootRef = React.useRef<HTMLElement>(null);
const titleId = React.useId();
const reduce = useReducedMotion();
const { scrollYProgress } = useScroll({ target: rootRef, offset: ["start end", "end start"] });
const yUp = useTransform(scrollYProgress, [0, 1], [36, -36]);
const yDown = useTransform(scrollYProgress, [0, 1], [-36, 36]);
const yPhoto = useTransform(scrollYProgress, [0, 1], ["-3%", "3%"]);
const moving = drift && !reduce;
const hasReviews = reviews.length > 0;
const hasPhoto = Boolean(photoImage);
const hasHalo = hasReviews || hasPhoto;
const colA = reviews.filter((_, i) => i % 2 === 0);
const colB = reviews.filter((_, i) => i % 2 === 1);
const forceHover = state === "hover";
const parsed = parseFloat(rating.replace(",", "."));
const ratingValue = Number.isFinite(parsed) ? parsed : 5;
const title = rating
? fillHeadline(ratingCount ? ratingHeadline : ratingHeadlineNoCount, rating, ratingCount, ratingValue, c.outOfFive)
: headline;
const hasAction = Boolean(actionLabel);
const hasFoot = punch.length > 0 || hasAction;
const haloCls = `cf-rating-halo__halo${hasPhoto ? "" : " is-no-photo"}${hasReviews ? "" : " is-no-reviews"}`;
// With photo and reviews, the action sits in the centre column under the photo: the eye goes face → button.
const inHalo = hasPhoto && hasReviews;
const btnCls = `cf-rating-halo__btn${forceHover ? " is-hover" : ""}`;
const actionInner = (
<>
<ShoppingCart size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{actionLabel}</span>
{price ? (
<>
<span className="cf-rating-halo__btn-sep" aria-hidden="true" />
<span className="cf-rating-halo__btn-price">{price}</span>
</>
) : null}
</>
);
const action = href ? (
<a
className={btnCls}
href={actionDisabled ? undefined : href}
aria-disabled={actionDisabled || undefined}
onClick={(e) => {
if (actionDisabled) {
e.preventDefault();
return;
}
onAction?.();
}}
>
{actionInner}
</a>
) : (
<button type="button" className={btnCls} disabled={actionDisabled} onClick={() => onAction?.()}>
{actionInner}
</button>
);
const footEl = hasFoot ? (
<div className={inHalo ? "cf-rating-halo__foot is-inset" : "cf-rating-halo__wrap cf-rating-halo__foot"}>
{punch.length ? (
<div className="cf-rating-halo__punch">
{punch.map((line, i) => {
const word = i === punch.length - 1 && !line.trim().includes(" ");
return (
<p key={i} className={word ? "is-word" : undefined}>
{line}
</p>
);
})}
</div>
) : null}
{hasAction ? action : null}
{hasAction && actionNote ? (
<p className="cf-rating-halo__note">
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden="true" />
{actionNote}
</p>
) : null}
</div>
) : null;
return (
<section
ref={rootRef}
className={`cf-rating-halo${hasHalo ? " has-halo" : ""}${className ? ` ${className}` : ""}`}
aria-labelledby={titleId}
>
<style>{CSS}</style>
<div className="cf-rating-halo__stage" style={FX_HOST}>
{backdropImage ? <Backdrop src={backdropImage} treatment="scrim-dark" /> : null}
<div className="cf-rating-halo__head">
<h2 id={titleId} className="cf-rating-halo__title">
{title}
</h2>
{source ? <p className="cf-rating-halo__source">{source}</p> : null}
</div>
</div>
{hasHalo ? (
<div className="cf-rating-halo__wrap">
<div className={haloCls}>
{colA.length ? (
<motion.ul className="cf-rating-halo__col cf-rating-halo__col--a" style={moving ? { y: yUp } : undefined}>
{colA.map((r, i) => (
<li key={i} className="cf-rating-halo__li" style={{ animationDelay: `${Math.min(i * 2 * 0.07, 0.28)}s` }}>
<ReviewCard review={r} hover={forceHover && i === 0} starsLabel={c.starsLabel} />
</li>
))}
</motion.ul>
) : null}
{hasPhoto ? (
<figure className="cf-rating-halo__photo">
<div className="cf-rating-halo__frame">
<motion.img
className="cf-rating-halo__img"
src={photoImage}
alt={photoAlt}
width={800}
height={1060}
style={moving ? { y: yPhoto, scale: 1.08 } : undefined}
/>
</div>
{photoCaption ? <figcaption className="cf-rating-halo__caption">{photoCaption}</figcaption> : null}
</figure>
) : null}
{colB.length ? (
<motion.ul className="cf-rating-halo__col cf-rating-halo__col--b" style={moving ? { y: yDown } : undefined}>
{colB.map((r, i) => (
<li key={i} className="cf-rating-halo__li" style={{ animationDelay: `${Math.min((i * 2 + 1) * 0.07, 0.28)}s` }}>
<ReviewCard review={r} hover={false} starsLabel={c.starsLabel} />
</li>
))}
</motion.ul>
) : null}
{hasReviews ? (
<ul className="cf-rating-halo__mlist" aria-label={c.reviewsRegion}>
{reviews.slice(0, Math.max(1, phoneReviews)).map((r, i) => (
<li key={i} className="cf-rating-halo__li" style={{ animationDelay: `${Math.min(i * 0.07, 0.28)}s` }}>
<ReviewCard review={r} hover={forceHover && i === 0} starsLabel={c.starsLabel} />
</li>
))}
</ul>
) : null}
{inHalo ? footEl : null}
</div>
</div>
) : null}
{!inHalo ? footEl : null}
{press.length ? (
<div className="cf-rating-halo__wrap cf-rating-halo__press">
<p className="cf-rating-halo__press-label">{pressLabel}</p>
<ul className="cf-rating-halo__press-list">
{press.map((p, i) => (
<li key={`${p.name}-${i}`} className={`cf-rating-halo__press-item${i % 3 === 1 ? " is-caps" : ""}`}>
{p.logo ? <img src={p.logo} alt={p.name} loading="lazy" /> : p.name}
</li>
))}
</ul>
</div>
) : null}
</section>
);
}
export default RatingHalo;
function ReviewCard({ review, hover, starsLabel }: { review: RatingHaloReview; hover: boolean; starsLabel: string }) {
const r = review.rating;
return (
<article className={`cf-rating-halo__card${hover ? " is-hover" : ""}`}>
{review.title ? <h3 className="cf-rating-halo__card-title">{review.title}</h3> : null}
<p className="cf-rating-halo__card-text">“{review.text}”</p>
<footer className="cf-rating-halo__card-foot">
{typeof r === "number" ? <StarRow value={r} size={16} label={starsLabel.replace("{rating}", String(r))} /> : null}
<span className="cf-rating-halo__who">
{review.name}
{review.date ? ` · ${review.date}` : null}
</span>
</footer>
</article>
);
}
function StarRow({ value, size, label }: { value: number; size: number | string; label?: string }) {
const v = Math.max(0, Math.min(5, value));
return (
<span
className="cf-rating-halo__stars"
role={label ? "img" : undefined}
aria-label={label}
aria-hidden={label ? undefined : true}
>
{[0, 1, 2, 3, 4].map((i) => {
const fill = Math.max(0, Math.min(1, v - i));
return (
<span key={i} className="cf-rating-halo__star">
<Star className="cf-rating-halo__star-empty" size={size} strokeWidth={2.5} fill="currentColor" aria-hidden="true" />
{fill > 0 ? (
<span className="cf-rating-halo__star-fill" style={{ width: `${fill * 100}%` }}>
<Star size={size} strokeWidth={2.5} fill="currentColor" aria-hidden="true" />
</span>
) : null}
</span>
);
})}
</span>
);
}
function fillHeadline(template: string, rating: string, count: string, value: number, outOf: string): React.ReactNode {
const t = template.replace("{rating} {stars}", "{rating}\u00a0{stars}").replace("{count} ", "{count}\u00a0");
return t.split(/(\{rating\}|\{stars\}|\{count\})/).map((part, i) => {
if (part === "{rating}") return <span key={i} className="cf-rating-halo__num">{rating}</span>;
if (part === "{count}") return <span key={i} className="cf-rating-halo__num">{count}</span>;
if (part === "{stars}")
return (
<span key={i} className="cf-rating-halo__hstars">
<StarRow value={value} size="0.72em" />
<span className="cf-rating-halo__sr">{` ${outOf}`}</span>
</span>
);
return part ? <React.Fragment key={i}>{part}</React.Fragment> : null;
});
}
const CSS = `
.cf-rating-halo{--rh-gutter:clamp(16px,5vw,48px);--rh-overlap:clamp(150px,17vw,230px);--rh-shadow:var(--shadow,oklch(0.22 0.03 256));--rh-star:oklch(from var(--warning,oklch(0.5 0.1 85)) 0.66 0.15 h);--rh-star-empty:oklch(from var(--ink,#1a2233) l c h / 0.16);position:relative;overflow-x:clip;background:var(--surface,#fff);color:var(--ink,#1a2233);font-family:var(--font-body,system-ui,sans-serif);padding-bottom:clamp(64px,8.5vw,120px)}
.cf-rating-halo *,.cf-rating-halo *::before,.cf-rating-halo *::after{box-sizing:border-box}
.cf-rating-halo__wrap{max-width:calc(1120px + 2 * var(--rh-gutter));margin-inline:auto;padding-inline:var(--rh-gutter)}
.cf-rating-halo__stage{background:var(--band,#1b2a4a);color:var(--band-ink,#fff);padding-top:clamp(56px,8vw,112px);padding-bottom:clamp(56px,7vw,96px)}
.cf-rating-halo.has-halo .cf-rating-halo__stage{padding-bottom:calc(var(--rh-overlap) + clamp(40px,5vw,64px))}
.cf-rating-halo__head{position:relative;z-index:1;max-width:calc(46rem + 2 * var(--rh-gutter));margin-inline:auto;padding-inline:var(--rh-gutter);text-align:center}
.cf-rating-halo__title{margin:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;color:var(--band-ink,#fff);text-wrap:balance}
.cf-rating-halo__num{font-variant-numeric:tabular-nums lining-nums}
.cf-rating-halo__hstars{--rh-star:oklch(from var(--warning,oklch(0.5 0.1 85)) 0.84 0.16 h);--rh-star-empty:oklch(from var(--band-ink,#fff) l c h / 0.28);display:inline-flex;align-items:center;white-space:nowrap;vertical-align:-0.06em;margin-inline:0.04em}
.cf-rating-halo__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-rating-halo__source{margin:16px auto 0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--band-ink,#fff);text-wrap:pretty}
.cf-rating-halo__stars{display:inline-flex;align-items:center;gap:0.1em;line-height:0}
.cf-rating-halo__star{position:relative;display:inline-flex}
.cf-rating-halo__star-empty{color:var(--rh-star-empty)}
.cf-rating-halo__star-fill{position:absolute;top:0;left:0;bottom:0;display:inline-flex;overflow:hidden;color:var(--rh-star)}
.cf-rating-halo__star-fill svg{flex:none}
.cf-rating-halo__halo{position:relative;z-index:1;margin-top:calc(-1 * var(--rh-overlap));display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.06fr) minmax(0,1fr);grid-template-rows:auto 1fr;grid-template-areas:"a photo b" "a foot b";gap:0 clamp(16px,2vw,28px);align-items:start}
.cf-rating-halo__halo.is-no-photo{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto;grid-template-areas:"a b";max-width:880px;margin-inline:auto}
.cf-rating-halo__halo.is-no-reviews{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;grid-template-areas:"photo";max-width:420px;margin-inline:auto}
.cf-rating-halo__col{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:20px}
.cf-rating-halo__col--a{grid-area:a;padding-top:clamp(32px,5vw,72px)}
.cf-rating-halo__col--b{grid-area:b}
.cf-rating-halo__li{display:flex}
.cf-rating-halo__li>.cf-rating-halo__card{flex:1}
.cf-rating-halo__photo{grid-area:photo;margin:0}
.cf-rating-halo__frame{position:relative;overflow:hidden;border-radius:12px;aspect-ratio:4/5.3;background:color-mix(in oklch,var(--ink,#1a2233) 8%,var(--surface,#fff))}
.cf-rating-halo__img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 35%}
.cf-rating-halo__caption{display:block;width:fit-content;max-width:100%;margin:14px auto 0;padding:6px 14px;border-radius:16px;background:color-mix(in oklch,var(--ink,#1a2233) 6%,var(--surface,#fff));color:var(--ink,#1a2233);font-size:0.875rem;font-weight:800;line-height:1.35;text-align:center;text-wrap:balance}
.cf-rating-halo__card{display:flex;flex-direction:column;background:var(--card,#fff);color:var(--ink,#1a2233);border:1px solid var(--card-border,oklch(from var(--ink,#1a2233) 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(--rh-shadow) l c h / 0.22),0 4px 10px -2px oklch(from var(--rh-shadow) l c h / 0.2)));padding:clamp(20px,3vw,32px);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.cf-rating-halo__card-title{margin:0 0 8px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.2;letter-spacing:-0.01em;text-wrap:balance}
.cf-rating-halo__card-text{margin:0 0 18px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
.cf-rating-halo__card-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin-top:auto;padding-top:14px;border-top:1px solid oklch(from var(--ink,#1a2233) l c h / 0.12)}
.cf-rating-halo__who{font-size:0.875rem;font-weight:800;line-height:1.2;letter-spacing:0.06em;text-transform:uppercase;color:var(--muted,#4a5568)}
@media (hover:hover){.cf-rating-halo__card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg,0 2px 4px oklch(from var(--rh-shadow) l c h / 0.22),0 12px 24px -8px oklch(from var(--rh-shadow) l c h / 0.32));border-color:oklch(from var(--ink,#1a2233) l c h / 0.22)}}
.cf-rating-halo__card.is-hover{transform:translateY(-3px);box-shadow:var(--shadow-lg,0 2px 4px oklch(from var(--rh-shadow) l c h / 0.22),0 12px 24px -8px oklch(from var(--rh-shadow) l c h / 0.32));border-color:oklch(from var(--ink,#1a2233) l c h / 0.22)}
.cf-rating-halo__mlist{display:none}
.cf-rating-halo__foot{margin-top:clamp(64px,7vw,96px);text-align:center}
.cf-rating-halo__foot.is-inset{grid-area:foot;align-self:start;margin-top:clamp(32px,4vw,48px)}
.cf-rating-halo__foot.is-inset .cf-rating-halo__btn{width:100%;min-width:0}
.cf-rating-halo__foot.is-inset .cf-rating-halo__punch{margin-bottom:20px}
.cf-rating-halo:not(.has-halo) .cf-rating-halo__foot{margin-top:clamp(40px,5vw,56px)}
.cf-rating-halo__punch{margin:0 0 24px}
.cf-rating-halo__punch p{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;text-wrap:balance}
.cf-rating-halo__punch p.is-word{margin-top:8px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06}
.cf-rating-halo__btn{--rh-b:var(--button-bg,var(--cta,oklch(0.576 0.209 29.5)));--rh-b2:var(--button-bg-2,var(--cta-2,oklch(0.506 0.206 29.5)));display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:64px;min-width:min(100%,320px);max-width:100%;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--rh-b) calc(l + 0.04) c h),oklch(from var(--rh-b2) calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink,#fff));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;white-space:nowrap;text-decoration:none;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rh-b) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--rh-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rh-shadow) l c h / 0.3),0 8px 16px -6px oklch(from var(--rh-shadow) l c h / 0.45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-rating-halo__btn:hover,.cf-rating-halo__btn.is-hover{background:linear-gradient(oklch(from var(--rh-b) calc(l - 0.01) c h),oklch(from var(--rh-b2) calc(l - 0.07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rh-b) calc(l + 0.1) c h / 0.7),inset 0 -3px 0 oklch(from var(--rh-b) calc(l - 0.2) c h),0 1px 2px oklch(from var(--rh-shadow) l c h / 0.32),0 10px 20px -6px oklch(from var(--rh-shadow) l c h / 0.55))}
.cf-rating-halo__btn:active{transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--rh-b) calc(l - 0.2) c h / 0.5),inset 0 -2px 0 oklch(from var(--rh-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rh-shadow) l c h / 0.3)}
.cf-rating-halo__btn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent,oklch(0.5 0.17 257))) l c h / 0.6);outline-offset:3px}
.cf-rating-halo__btn:disabled,.cf-rating-halo__btn[aria-disabled=true]{background:var(--secondary,oklch(0.93 0.015 263));color:var(--secondary-ink,#1a2233);text-shadow:none;box-shadow:var(--shadow-sm,0 1px 3px oklch(from var(--rh-shadow) l c h / 0.2));cursor:not-allowed;transform:none}
.cf-rating-halo__btn-sep{width:1px;height:1.1em;background:currentColor;opacity:0.4}
.cf-rating-halo__btn-price{font-variant-numeric:tabular-nums lining-nums}
.cf-rating-halo__note{margin:12px auto 0;max-width:46ch;font-size:0.9375rem;font-weight:500;line-height:1.4;color:var(--muted,#4a5568);text-wrap:balance}
.cf-rating-halo__note svg{display:inline-block;vertical-align:-0.18em;margin-inline-end:0.4em;color:var(--success,oklch(0.5 0.14 150))}
.cf-rating-halo__press{margin-top:clamp(48px,6vw,80px);text-align:center}
.cf-rating-halo__press-label{margin:0 0 16px;font-size:0.875rem;font-weight:800;line-height:1.2;letter-spacing:0.08em;text-transform:uppercase;color:var(--muted,#4a5568)}
.cf-rating-halo__press-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px clamp(24px,4vw,56px)}
.cf-rating-halo__press-item{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.2;letter-spacing:-0.02em;color:var(--muted,#4a5568);white-space:nowrap}
.cf-rating-halo__press-item.is-caps{text-transform:uppercase;letter-spacing:0.08em}
.cf-rating-halo__press-item img{display:block;height:28px;width:auto;max-width:160px;object-fit:contain;filter:grayscale(1);opacity:0.75}
@media (max-width:900px){
.cf-rating-halo{--rh-overlap:88px}
.cf-rating-halo__halo,.cf-rating-halo__halo.is-no-photo,.cf-rating-halo__halo.is-no-reviews{display:flex;flex-direction:column;gap:20px;max-width:none}
.cf-rating-halo__col{display:none}
.cf-rating-halo__frame{aspect-ratio:4/3.3}
.cf-rating-halo__img{object-position:50% 22%}
.cf-rating-halo__mlist{display:flex;flex-direction:column;gap:16px;list-style:none;margin:4px 0 0;padding:0}
.cf-rating-halo__foot,.cf-rating-halo__foot.is-inset{margin-top:40px;align-self:stretch}
.cf-rating-halo__btn{width:100%;min-width:0;max-width:420px}
}
@media (prefers-reduced-motion:no-preference){.cf-rating-halo__li{animation:cf-rating-halo-rise .45s cubic-bezier(.2,.7,.2,1) both}}
@keyframes cf-rating-halo-rise{from{opacity:.82;transform:translateY(8px)}}
@media (prefers-reduced-motion:reduce){.cf-rating-halo__card,.cf-rating-halo__btn{transition:none}.cf-rating-halo__card:hover,.cf-rating-halo__card.is-hover,.cf-rating-halo__btn:active{transform:none}}
`;
pieces/proof/rating-halo/specimen.tsx 85 lines
import __studioImage2ca9bbab from "../assets/6dfee132633aaffd.webp";
// Specimen: Pantry Pal meal-planning app. Rating, reviews and press names are clearly fictional sample content.
import { RatingHalo } from "../rating-halo";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
import kitchen from "../../fx/backdrops/kitchen";
export const states = ["default", "hover"];
const reviews = [
{
title: "Sunday planning, finally painless",
text: "I plan the whole week in one sitting now. The grocery list builds itself while I pick meals.",
name: "Dana R.",
date: "Oct 2026",
rating: 5,
},
{
title: "We stopped wasting groceries",
text: "It uses what's already in my pantry first. Half a bag of spinach is dinner now, not trash.",
name: "Marcus T.",
date: "Sep 2026",
rating: 5,
},
{
title: "Picky kids, sorted",
text: "Each kid gets a favourite night. Fewer fights at the table. I didn't think an app could do that.",
name: "Priya S.",
date: "Aug 2026",
rating: 5,
},
{
title: "The list is the magic",
text: "My list comes sorted by aisle. I'm in and out of the store in twenty minutes.",
name: "Jonah K.",
date: "Oct 2026",
rating: 5,
},
{
title: "Three apps became one",
text: "Meals, the shopping list and leftovers all live in one place. That alone was worth it.",
name: "Elena M.",
date: "Jul 2026",
rating: 4,
},
{
title: "Dinner is decided by 9am",
text: "One reminder in the morning and I already know what's for dinner. Less stress, every single day.",
name: "Chris W.",
date: "Sep 2026",
rating: 5,
},
];
const press = [
{ name: "Weeknight Table" },
{ name: "Home Cook Weekly" },
{ name: "The Grocery Report" },
{ name: "Plate & Pantry" },
];
export default function RatingHaloSpecimen({ state = "default" }: { state?: string }) {
const sample = defaults.sample;
return (
<RatingHalo
state={state === "hover" ? "hover" : "default"}
rating="4.8"
ratingCount="12,400"
source="Here's what home cooks write in their Pantry Pal reviews."
reviews={reviews}
photoImage={slot(
"scene",
__studioImage2ca9bbab
)}
photoAlt="A home cook planning the week's meals on her phone at the kitchen counter"
photoCaption="The whole week, planned in one sitting"
backdropImage={kitchen}
punch={["Plan the week once.", "Shop once.", "Done."]}
actionLabel="Add To Cart"
price={sample.price}
actionNote={`One payment · ${sample.guarantee}`}
press={press}
/>
);
}
| Name | Type | Details |
|---|---|---|
rating OptionalRatingHalo |
string |
|
ratingCount OptionalRatingHalo |
string |
|
ratingHeadline OptionalRatingHalo |
string |
|
ratingHeadlineNoCount OptionalRatingHalo |
string |
|
headline OptionalRatingHalo |
React.ReactNode |
|
source OptionalRatingHalo |
React.ReactNode |
|
reviews OptionalRatingHalo |
RatingHaloReview[] |
|
photoImage OptionalRatingHalo |
string |
|
photoAlt OptionalRatingHalo |
string |
|
photoCaption OptionalRatingHalo |
string |
|
backdropImage OptionalRatingHalo |
string |
|
punch OptionalRatingHalo |
string[] |
|
actionLabel OptionalRatingHalo |
string |
|
price OptionalRatingHalo |
string |
|
actionNote OptionalRatingHalo |
string |
|
href OptionalRatingHalo |
string |
|
onAction OptionalRatingHalo |
() => void |
|
actionDisabled OptionalRatingHalo |
boolean |
|
pressLabel OptionalRatingHalo |
string |
|
press OptionalRatingHalo |
RatingHaloPress[] |
|
drift OptionalRatingHalo |
boolean |
|
phoneReviews OptionalRatingHalo |
number |
|
state OptionalRatingHalo |
"default" | "hover" |
|
copy OptionalRatingHalo |
{ starsLabel?: string; outOfFive?: string; reviewsRegion?: string } |
|
className OptionalRatingHalo |
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.
scene- A wide atmosphere photo behind or beside the copy.
-
4b82104bfd627615.webp
image/webp · 44.9 KB
-
59f3da641341e0e5.webp
image/webp · 37.7 KB
-
6dfee132633aaffd.webp
image/webp · 113 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB