Review Request 1
Review request: a five-question buyer interview (stars, the result they got, optional photos, permission to share) that turns happy customers into usable proof and hands every answer to onSubmit.
Use it in a prompt
Use forms/review-request 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/forms/review-request.tsx. - Import it and pass your copy and images (Props tab):
import { ReviewRequest } from "@/components/funneldna/forms/review-request"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/review-request/component.tsx 692 lines
// layout: interview-qa
// Review request: a five-question buyer interview (stars, the result they got, optional photos, permission to share) that turns happy customers into usable proof and hands every answer to onSubmit.
import React, { useEffect, useId, useRef, useState } from "react";
import { AlertCircle, Check, ImagePlus, Loader2, Lock, Star, X } from "lucide-react";
export type ReviewRequestItem = {
name: string;
image?: string; // slot item-1 … item-3, shown as the kit thumbnails in the header
imageAlt?: string;
};
export type ReviewRequestValues = {
rating: number;
ratingLabel: string;
question: string; // the result question the buyer saw (it adapts to the rating)
story: string;
photos: File[]; // local files only; the builder decides where they go
permission: boolean;
displayName: string;
};
type Tier = "high" | "mid" | "low";
export type ReviewRequestCopy = {
headline: string; // {product}
lead: string;
kitLabel: string;
q1: string; // {product}
q1Help: string;
ratingPrompt: string;
ratingLabels: [string, string, string, string, string];
ratingValue: string; // {rating}, {label}
ratingAria: string; // {n}, {label}
ratingError: string;
q2: Record<Tier, string>; // high = 4-5 stars or none yet, mid = 3, low = 1-2
q2Help: Record<Tier, string>;
startersLabel: string;
starters: Record<Tier, string[]>; // inserted into the answer, shown with an ellipsis
storyLabel: string;
storyPlaceholder: string;
counterLeft: string; // {left}
counterLeftOne: string;
counterDone: string;
storyError: string; // {min}
q3: string;
q3Help: string;
dropTitle: string;
dropNote: string; // {max}, {mb}
fullNote: string; // {max}
chooseLabel: string;
photoAlt: string; // {n}
removeAria: string; // {n}
typeError: string;
sizeError: string; // {name}, {mb}
countError: string; // {max}
q4: string;
q4Help: string;
permissionLabel: string;
nameLabel: string;
namePlaceholder: string;
q5: string;
q5Help: string;
button: string; // {product}
sending: string;
reassurance: string;
summaryError: string;
};
export type ReviewRequestProps = {
productName?: string; // used in the headline, first question and button
items?: ReviewRequestItem[]; // up to three thumbnails of what they bought
copy?: Partial<ReviewRequestCopy>;
minLength?: number; // characters needed in the result answer
maxPhotos?: number;
maxPhotoMB?: number;
submitting?: boolean; // shows the loading button while the builder sends
onSubmit?: (values: ReviewRequestValues) => void;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
export function ReviewRequest(props: ReviewRequestProps) {
const {
productName = "Funnel Starter Kit",
items = [],
copy,
minLength = 20,
maxPhotos = 3,
maxPhotoMB = 10,
submitting = false,
onSubmit,
state = "default",
className,
} = props;
const c: ReviewRequestCopy = { ...DEFAULT_COPY, ...copy };
const uid = useId();
const titleId = uid + "-title";
const qId = (n: number) => uid + "-q" + n;
const storyId = uid + "-story";
const counterId = uid + "-counter";
const storyErrId = uid + "-story-err";
const ratingErrId = uid + "-rating-err";
const dropNoteId = uid + "-drop-note";
const nameId = uid + "-name";
const startersId = uid + "-starters";
const [rating, setRating] = useState(0);
const [hover, setHover] = useState(0);
const [story, setStory] = useState("");
const [photos, setPhotos] = useState<Photo[]>([]);
const [photoError, setPhotoError] = useState("");
const [dragging, setDragging] = useState(false);
const [permission, setPermission] = useState(false);
const [displayName, setDisplayName] = useState("");
const [submitted, setSubmitted] = useState(state === "error");
const storyRef = useRef<HTMLTextAreaElement>(null);
const firstStarRef = useRef<HTMLInputElement>(null);
const fileRef = useRef<HTMLInputElement>(null);
const photoCount = useRef(0);
const photosRef = useRef<Photo[]>([]);
useEffect(() => {
if (state === "error") setSubmitted(true);
}, [state]);
useEffect(() => {
photosRef.current = photos;
}, [photos]);
useEffect(
() => () => {
photosRef.current.forEach((photo) => URL.revokeObjectURL(photo.url));
},
[]
);
const disabled = state === "disabled";
const tier: Tier = rating === 0 || rating >= 4 ? "high" : rating === 3 ? "mid" : "low";
const shown = disabled ? rating : hover || rating;
const left = Math.max(0, minLength - story.trim().length);
const ratingInvalid = submitted && rating === 0;
const storyInvalid = submitted && left > 0;
const full = photos.length >= maxPhotos;
const vars = { product: productName };
const thumbs = items.filter((item) => item.image).slice(0, 3);
function insertStarter(starter: string) {
const base = story.trimEnd();
const next = (base ? base + " " : "") + starter + " ";
setStory(next);
requestAnimationFrame(() => {
const el = storyRef.current;
if (!el) return;
el.focus();
el.setSelectionRange(next.length, next.length);
});
}
function addFiles(list: FileList | null) {
if (!list || list.length === 0) return;
const next = [...photos];
let error = "";
for (const file of Array.from(list)) {
if (!ACCEPTED.includes(file.type.toLowerCase())) {
error = c.typeError;
continue;
}
if (file.size > maxPhotoMB * 1024 * 1024) {
error = fill(c.sizeError, { name: file.name, mb: maxPhotoMB });
continue;
}
if (next.length >= maxPhotos) {
error = fill(c.countError, { max: maxPhotos });
break;
}
photoCount.current += 1;
next.push({ id: photoCount.current, file, url: URL.createObjectURL(file) });
}
setPhotos(next);
setPhotoError(error);
}
function removePhoto(id: number) {
const target = photos.find((photo) => photo.id === id);
if (target) URL.revokeObjectURL(target.url);
setPhotos(photos.filter((photo) => photo.id !== id));
setPhotoError("");
}
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
if (disabled || submitting) return;
setSubmitted(true);
if (rating === 0) {
firstStarRef.current?.focus();
return;
}
if (story.trim().length < minLength) {
storyRef.current?.focus();
return;
}
onSubmit?.({
rating,
ratingLabel: c.ratingLabels[rating - 1],
question: c.q2[tier],
story: story.trim(),
photos: photos.map((photo) => photo.file),
permission,
displayName: permission ? displayName.trim() : "",
});
}
const buttonClass =
"rr-submit" + (state === "hover" ? " is-hover" : "") + (state === "active" ? " is-active" : "");
return (
<section className={["cf-review-request", className].filter(Boolean).join(" ")} aria-labelledby={titleId}>
<style>{CSS}</style>
<div className="rr-top">
<div className="rr-wrap">
<div className="rr-head">
<h2 id={titleId} className="rr-h2">
{fill(c.headline, vars)}
</h2>
<p className="rr-lead">{c.lead}</p>
<div className="rr-kit">
{thumbs.length > 0 ? (
<ul className="rr-kit-thumbs">
{thumbs.map((item, i) => (
<li key={item.name + i}>
<img src={item.image} alt={item.imageAlt || item.name} width={64} height={64} />
</li>
))}
</ul>
) : null}
<p className="rr-kit-text">
<span>{c.kitLabel}</span>
<strong>{productName}</strong>
</p>
</div>
</div>
</div>
</div>
<div className="rr-body">
<div className="rr-wrap">
<form className="rr-card" noValidate onSubmit={handleSubmit} aria-labelledby={titleId}>
<fieldset className="rr-fieldset" disabled={disabled}>
<Row n={1} id={qId(1)} index={0} question={fill(c.q1, vars)} help={c.q1Help}>
<div
role="radiogroup"
className="rr-stars"
aria-labelledby={qId(1)}
aria-describedby={ratingInvalid ? ratingErrId : qId(1) + "-help"}
aria-invalid={ratingInvalid || undefined}
aria-required="true"
onMouseLeave={() => setHover(0)}
>
{[1, 2, 3, 4, 5].map((n) => (
<label
key={n}
className={"rr-star" + (n <= shown ? " is-on" : "")}
onMouseEnter={() => {
if (!disabled) setHover(n);
}}
>
<input
ref={n === 1 ? firstStarRef : undefined}
className="rr-sr"
type="radio"
name={uid + "-rating"}
value={n}
checked={rating === n}
onChange={() => setRating(n)}
aria-label={fill(c.ratingAria, { n, label: c.ratingLabels[n - 1] })}
/>
<span className="rr-star-face" aria-hidden="true">
<Star strokeWidth={2.5} />
</span>
</label>
))}
</div>
<p className={"rr-readout" + (shown ? " is-set" : "")} aria-hidden="true">
{shown ? fill(c.ratingValue, { rating: shown, label: c.ratingLabels[shown - 1] }) : c.ratingPrompt}
</p>
{ratingInvalid ? (
<p className="rr-error" id={ratingErrId}>
<AlertCircle className="rr-inline-icon" strokeWidth={2.5} aria-hidden="true" />
{c.ratingError}
</p>
) : null}
</Row>
<Row n={2} id={qId(2)} index={1} swapKey={tier} question={c.q2[tier]} help={c.q2Help[tier]}>
<div className="rr-starters" key={tier}>
<p className="rr-starters-label" id={startersId}>
{c.startersLabel}
</p>
<ul className="rr-chips" aria-labelledby={startersId}>
{c.starters[tier].map((starter) => (
<li key={starter}>
<button type="button" className="rr-chip" onClick={() => insertStarter(starter)}>
{starter}…
</button>
</li>
))}
</ul>
</div>
<label className="rr-sr" htmlFor={storyId}>
{c.storyLabel}
</label>
<textarea
ref={storyRef}
id={storyId}
className="rr-field"
rows={5}
value={story}
onChange={(event) => setStory(event.target.value)}
placeholder={c.storyPlaceholder}
required
aria-invalid={storyInvalid || undefined}
aria-describedby={[qId(2) + "-help", counterId, storyInvalid ? storyErrId : ""].filter(Boolean).join(" ")}
/>
<p className={"rr-counter" + (left === 0 ? " is-done" : "")} id={counterId} aria-live="polite">
{left === 0 ? (
<>
<Check className="rr-inline-icon" strokeWidth={2.5} aria-hidden="true" />
{c.counterDone}
</>
) : left === 1 ? (
c.counterLeftOne
) : (
fill(c.counterLeft, { left })
)}
</p>
{storyInvalid ? (
<p className="rr-error" id={storyErrId}>
<AlertCircle className="rr-inline-icon" strokeWidth={2.5} aria-hidden="true" />
{fill(c.storyError, { min: minLength })}
</p>
) : null}
</Row>
<Row n={3} id={qId(3)} index={2} question={c.q3} help={c.q3Help}>
<div
className={"rr-drop" + (dragging ? " is-over" : "")}
onDragOver={(event: React.DragEvent<HTMLDivElement>) => {
if (disabled || full) return;
event.preventDefault();
setDragging(true);
}}
onDragLeave={() => setDragging(false)}
onDrop={(event: React.DragEvent<HTMLDivElement>) => {
event.preventDefault();
setDragging(false);
if (!disabled) addFiles(event.dataTransfer.files);
}}
>
<span className="rr-disc" aria-hidden="true">
<ImagePlus strokeWidth={2.5} />
</span>
<div className="rr-drop-text">
<p className="rr-drop-title">{c.dropTitle}</p>
<p className="rr-drop-note" id={dropNoteId}>
{full ? fill(c.fullNote, { max: maxPhotos }) : fill(c.dropNote, { max: maxPhotos, mb: maxPhotoMB })}
</p>
</div>
<button
type="button"
className="rr-btn-2"
disabled={full}
aria-describedby={dropNoteId}
onClick={() => fileRef.current?.click()}
>
{c.chooseLabel}
</button>
<input
ref={fileRef}
className="rr-sr"
type="file"
accept={ACCEPTED.join(",")}
multiple
tabIndex={-1}
aria-hidden="true"
onChange={(event) => {
addFiles(event.target.files);
event.target.value = "";
}}
/>
</div>
{photos.length > 0 ? (
<ul className="rr-photos">
{photos.map((photo, i) => (
<li className="rr-photo" key={photo.id}>
<img src={photo.url} alt={fill(c.photoAlt, { n: i + 1 })} />
<button
type="button"
className="rr-remove"
aria-label={fill(c.removeAria, { n: i + 1 })}
onClick={() => removePhoto(photo.id)}
>
<X strokeWidth={2.5} aria-hidden="true" />
</button>
</li>
))}
</ul>
) : null}
{photoError ? (
<p className="rr-error" role="alert">
<AlertCircle className="rr-inline-icon" strokeWidth={2.5} aria-hidden="true" />
{photoError}
</p>
) : null}
</Row>
<Row n={4} id={qId(4)} index={3} question={c.q4} help={c.q4Help}>
<label className={"rr-check" + (permission ? " is-on" : "")}>
<input
className="rr-sr"
type="checkbox"
checked={permission}
onChange={(event) => setPermission(event.target.checked)}
aria-describedby={qId(4) + "-help"}
/>
<span className="rr-box" aria-hidden="true">
<Check strokeWidth={3} />
</span>
<span className="rr-check-text">{c.permissionLabel}</span>
</label>
{permission ? (
<div className="rr-name">
<label className="rr-label" htmlFor={nameId}>
{c.nameLabel}
</label>
<input
id={nameId}
className="rr-field"
type="text"
autoComplete="name"
value={displayName}
onChange={(event) => setDisplayName(event.target.value)}
placeholder={c.namePlaceholder}
/>
</div>
) : null}
</Row>
<Row n={5} id={qId(5)} index={4} question={c.q5} help={c.q5Help}>
<div className="rr-send">
<button type="submit" className={buttonClass} disabled={disabled || submitting} aria-busy={submitting || undefined}>
{submitting ? (
<>
<Loader2 className="rr-spin" strokeWidth={2.5} aria-hidden="true" />
{c.sending}
</>
) : (
fill(c.button, vars)
)}
</button>
{ratingInvalid || storyInvalid ? (
<p className="rr-error" role="alert">
<AlertCircle className="rr-inline-icon" strokeWidth={2.5} aria-hidden="true" />
{c.summaryError}
</p>
) : null}
<p className="rr-note">
<Lock className="rr-inline-icon" strokeWidth={2.5} aria-hidden="true" />
{c.reassurance}
</p>
</div>
</Row>
</fieldset>
</form>
</div>
</div>
</section>
);
}
export default ReviewRequest;
type Photo = { id: number; file: File; url: string };
const ACCEPTED = ["image/png", "image/jpeg", "image/webp", "image/heic", "image/heif"];
// private
function Row(props: {
n: number;
id: string;
index: number;
question: string;
help?: string;
swapKey?: string;
children: React.ReactNode;
}) {
const { n, id, index, question, help, swapKey, children } = props;
return (
<div className="rr-row" style={{ animationDelay: Math.min(index * 0.07, 0.28) + "s" }}>
<div className="rr-q">
<span className="rr-num" aria-hidden="true">
{String(n).padStart(2, "0")}
</span>
<div className="rr-q-text" key={swapKey}>
<h3 className="rr-h3" id={id}>
{question}
</h3>
{help ? (
<p className="rr-help" id={id + "-help"}>
{help}
</p>
) : null}
</div>
</div>
<div className="rr-a">{children}</div>
</div>
);
}
function fill(template: string, values: Record<string, string | number>) {
return Object.keys(values).reduce(
(text, key) => text.split("{" + key + "}").join(String(values[key])),
template
);
}
const DEFAULT_COPY: ReviewRequestCopy = {
headline: "How did the {product} work for you?",
lead: "Four quick questions, about two minutes. Your honest answer helps the next person decide if it's right for them.",
kitLabel: "You're reviewing",
q1: "How many stars does the {product} earn?",
q1Help: "Tap a star. An honest three helps us more than a polite five.",
ratingPrompt: "Tap a star to rate",
ratingLabels: ["Not for me", "It was okay", "Helpful", "Really helpful", "It changed how I build"],
ratingValue: "{rating} of 5 · {label}",
ratingAria: "{n} of 5 stars, {label}",
ratingError: "Pick a star rating to continue.",
q2: {
high: "What result did you get?",
mid: "What worked, and what didn't?",
low: "What would have made it better?",
},
q2Help: {
high: "Name one thing that changed: a page that went live, a plan you finished, an evening you saved.",
mid: "Tell us the part that helped and the part that slowed you down.",
low: "Be specific. Your answer shows us exactly what to fix.",
},
startersLabel: "Stuck? Tap a starter:",
starters: {
high: ["I finished my funnel map in", "My first page went live after", "The launch checklist caught", "Before the kit, I"],
mid: ["The most useful part was", "I got stuck on", "I'd like more help with"],
low: ["I expected", "It would help if", "The part that didn't work for me was"],
},
storyLabel: "Your answer",
storyPlaceholder: "My funnel map was done the first evening, and…",
counterLeft: "{left} more characters to go",
counterLeftOne: "1 more character to go",
counterDone: "Looks good. Add more if you like.",
storyError: "Tell us a little more, at least {min} characters.",
q3: "Got a photo of your funnel?",
q3Help: "Optional. A screenshot of your page or a snap of your filled-in workbook.",
dropTitle: "Add a photo of your result",
dropNote: "Drag it here or choose a file. Up to {max} photos, {mb} MB each.",
fullNote: "That's {max} photos. Remove one to swap it.",
chooseLabel: "Choose photos",
photoAlt: "Your photo {n}",
removeAria: "Remove photo {n}",
typeError: "Photos only, please: JPG, PNG, WebP or HEIC.",
sizeError: "{name} is over {mb} MB. Try a smaller copy.",
countError: "You can add up to {max} photos.",
q4: "Can we share your review?",
q4Help: "Only if you say yes. You choose the name we show.",
permissionLabel: "Yes, you can share my review and photos on your pages and emails.",
nameLabel: "Name to show with your review",
namePlaceholder: "Dana R., Austin",
q5: "Ready to send it?",
q5Help: "One click and your answers are on their way to the team.",
button: "Yes! Send my {product} review",
sending: "Sending your review…",
reassurance: "Nothing is shared unless you ticked yes above.",
summaryError: "Check the marked answers above, then send.",
};
const CSS = `
.cf-review-request{--rr-gutter:clamp(16px,5vw,48px);--rr-star:var(--review-star,var(--accent-fill,var(--accent)));--rr-line:oklch(from var(--ink) l c h / .12);--rr-shadow:var(--shadow,oklch(.22 .03 260));--rr-focus:oklch(from var(--field-focus,var(--accent)) l c h / .35);position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;}
.cf-review-request *,.cf-review-request *::before,.cf-review-request *::after{box-sizing:border-box;}
.cf-review-request .rr-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;accent-color:var(--field-focus,var(--accent));}
.cf-review-request .rr-top{background:var(--band);color:var(--band-ink);padding:clamp(56px,8vw,112px) var(--rr-gutter) clamp(128px,15vw,184px);}
.cf-review-request .rr-wrap{max-width:1120px;margin:0 auto;}
.cf-review-request .rr-head{max-width:46rem;}
.cf-review-request .rr-h2{margin:0 0 16px;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,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--band-ink);}
.cf-review-request .rr-lead{margin:0;max-width:40em;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--band-ink);text-wrap:pretty;}
.cf-review-request .rr-kit{display:flex;flex-wrap:wrap;align-items:center;gap:16px;margin-top:28px;}
.cf-review-request .rr-kit-thumbs{display:flex;gap:8px;margin:0;padding:0;list-style:none;}
.cf-review-request .rr-kit-thumbs img{display:block;width:64px;height:64px;object-fit:cover;object-position:center;border-radius:8px;filter:drop-shadow(0 2px 3px oklch(from var(--rr-shadow) l c h / .35));}
.cf-review-request .rr-kit-text{display:flex;flex-direction:column;gap:2px;margin:0;font-size:15px;line-height:1.4;font-weight:600;color:var(--band-ink);}
.cf-review-request .rr-kit-text strong{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:800;}
.cf-review-request .rr-body{position:relative;padding:0 var(--rr-gutter) clamp(64px,8.5vw,120px);margin-top:calc(-1 * clamp(96px,11vw,136px));}
.cf-review-request .rr-card{background:var(--card);color:var(--ink);border:1px solid var(--card-border,color-mix(in oklch,var(--ink) 12%,transparent));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 3px oklch(from var(--rr-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--rr-shadow) l c h / .32)));padding:clamp(8px,2vw,16px) clamp(20px,4vw,48px);}
.cf-review-request .rr-fieldset{border:0;margin:0;padding:0;min-width:0;}
.cf-review-request .rr-row{display:grid;gap:16px;padding:clamp(24px,3.2vw,36px) 0;animation:rr-rise .45s cubic-bezier(.2,.7,.2,1) both;}
.cf-review-request .rr-row + .rr-row{border-top:1px solid var(--rr-line);}
@media (min-width:860px){.cf-review-request .rr-row{grid-template-columns:minmax(0,4fr) minmax(0,8fr);gap:clamp(32px,4vw,56px);}}
.cf-review-request .rr-q{display:grid;grid-template-columns:auto minmax(0,1fr);gap:16px;align-items:start;}
.cf-review-request .rr-num{min-width:2ch;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;font-variant-numeric:tabular-nums;color:var(--accent);}
.cf-review-request .rr-q-text{animation:rr-rise .45s cubic-bezier(.2,.7,.2,1) both;}
.cf-review-request .rr-h3{margin:0;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;color:var(--ink);text-wrap:balance;}
.cf-review-request .rr-help{margin:8px 0 0;font-size:15px;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty;}
.cf-review-request .rr-a{position:relative;min-width:0;}
.cf-review-request .rr-stars{display:flex;flex-wrap:wrap;gap:4px;margin-left:-6px;}
.cf-review-request .rr-star{position:relative;display:grid;place-items:center;width:52px;height:52px;border-radius:12px;cursor:pointer;}
.cf-review-request .rr-star-face{display:grid;place-items:center;width:100%;height:100%;border-radius:inherit;}
.cf-review-request .rr-star-face svg{width:40px;height:40px;fill:transparent;stroke:color-mix(in oklch,var(--ink) 52%,var(--card));transition:transform .16s ease,fill .16s ease,stroke .16s ease;}
.cf-review-request .rr-star.is-on .rr-star-face svg{fill:var(--rr-star);stroke:oklch(from var(--rr-star) calc(l - .1) c h);animation:rr-pop .3s cubic-bezier(.2,.7,.2,1);}
.cf-review-request .rr-star:hover .rr-star-face svg{transform:scale(1.08);}
.cf-review-request .rr-star input:focus-visible + .rr-star-face{outline:3px solid var(--rr-focus);outline-offset:0;}
.cf-review-request .rr-stars[aria-invalid=true] .rr-star-face svg{stroke:var(--danger);}
.cf-review-request .rr-fieldset:disabled .rr-star{cursor:not-allowed;}
.cf-review-request .rr-fieldset:disabled .rr-star:hover .rr-star-face svg{transform:none;}
.cf-review-request .rr-readout{display:inline-flex;align-items:center;min-height:32px;margin:12px 0 0;padding:4px 12px;border-radius:999px;font-size:14px;line-height:1.2;font-weight:800;color:var(--ink);background:color-mix(in oklch,var(--ink) 6%,var(--card));}
.cf-review-request .rr-readout.is-set{background:color-mix(in oklch,var(--accent) 12%,var(--card));}
.cf-review-request .rr-error{margin:12px 0 0;font-size:15px;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty;overflow-wrap:anywhere;}
.cf-review-request .rr-inline-icon{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em;}
.cf-review-request .rr-starters{margin:0 0 12px;animation:rr-rise .45s cubic-bezier(.2,.7,.2,1) both;}
.cf-review-request .rr-starters-label{margin:0 0 8px;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted);}
.cf-review-request .rr-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none;}
.cf-review-request .rr-chip{min-height:40px;padding:8px 16px;border-radius:999px;border:1px solid var(--button-2-border,oklch(from var(--ink) l c h / .08));background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-family:var(--font-body);font-size:15px;line-height:1.2;font-weight:700;text-align:left;cursor:pointer;transition:background .16s ease,transform .16s ease;}
.cf-review-request .rr-chip:hover:not(:disabled){background:color-mix(in oklch,var(--ink) 11%,var(--card));}
.cf-review-request .rr-chip:active:not(:disabled){transform:translateY(1px);}
.cf-review-request .rr-chip:focus-visible{outline:3px solid var(--rr-focus);outline-offset:2px;}
.cf-review-request .rr-chip:disabled{cursor:not-allowed;color:var(--muted);}
.cf-review-request .rr-field{display:block;width:100%;min-height:56px;padding:14px 16px;font-family:var(--font-body);font-size:17px;line-height:1.45;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--rr-shadow) l c h / .06);transition:border-color .16s ease,box-shadow .16s ease;}
.cf-review-request textarea.rr-field{min-height:152px;resize:vertical;}
.cf-review-request .rr-field::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1;}
.cf-review-request .rr-field:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 38%,transparent);}
.cf-review-request .rr-field:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px var(--rr-focus);}
.cf-review-request .rr-field[aria-invalid=true]{border-color:var(--danger);}
.cf-review-request .rr-field[aria-invalid=true]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3);}
.cf-review-request .rr-field:disabled{background:color-mix(in oklch,var(--field-ink) 5%,var(--field));color:color-mix(in oklch,var(--field-ink) 70%,var(--field));cursor:not-allowed;}
.cf-review-request .rr-counter{margin:8px 0 0;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted);}
.cf-review-request .rr-counter.is-done{color:var(--success);}
.cf-review-request .rr-drop{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:20px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));border:1px solid oklch(from var(--ink) l c h / .1);transition:background .16s ease,border-color .16s ease;}
.cf-review-request .rr-drop.is-over{background:color-mix(in oklch,var(--accent) 10%,var(--card));border-color:var(--accent);}
.cf-review-request .rr-disc{flex:0 0 auto;display:grid;place-items:center;width:40px;height:40px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));}
.cf-review-request .rr-disc svg{width:20px;height:20px;}
.cf-review-request .rr-drop-text{flex:1 1 14rem;min-width:0;}
.cf-review-request .rr-drop-title{margin:0;font-size:17px;line-height:1.3;font-weight:700;color:var(--ink);}
.cf-review-request .rr-drop-note{margin:4px 0 0;font-size:15px;line-height:1.4;color:var(--muted);text-wrap:pretty;}
.cf-review-request .rr-btn-2{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.15;white-space:nowrap;color:var(--button-2-ink,var(--secondary-ink));background:var(--button-2-bg,var(--secondary));border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:pointer;transition:transform .16s ease,background .16s ease,box-shadow .16s ease;}
.cf-review-request .rr-btn-2:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h);}
.cf-review-request .rr-btn-2:active:not(:disabled){transform:translateY(1px);box-shadow:none;}
.cf-review-request .rr-btn-2:focus-visible{outline:3px solid var(--rr-focus);outline-offset:2px;}
.cf-review-request .rr-btn-2:disabled{opacity:.6;cursor:not-allowed;}
.cf-review-request .rr-photos{display:flex;flex-wrap:wrap;gap:16px;margin:16px 0 0;padding:0;list-style:none;}
.cf-review-request .rr-photo{position:relative;width:96px;height:96px;}
.cf-review-request .rr-photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;border-radius:8px;animation:rr-pop .3s cubic-bezier(.2,.7,.2,1);}
.cf-review-request .rr-remove{position:absolute;top:-10px;right:-10px;display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:999px;font-family:var(--button-font,var(--font-display));background:var(--card);color:var(--ink);box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--rr-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--rr-shadow) l c h / .2));cursor:pointer;transition:background .16s ease,color .16s ease;}
.cf-review-request .rr-remove::before{content:'';position:absolute;inset:-6px;}
.cf-review-request .rr-remove svg{width:16px;height:16px;}
.cf-review-request .rr-remove:hover:not(:disabled){background:var(--danger);color:var(--card);}
.cf-review-request .rr-remove:focus-visible{outline:3px solid var(--rr-focus);outline-offset:2px;}
.cf-review-request .rr-check{position:relative;display:flex;align-items:flex-start;gap:12px;min-height:44px;padding:14px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));color:var(--ink);font-weight:600;line-height:1.4;cursor:pointer;transition:background .16s ease;}
.cf-review-request .rr-check.is-on{background:color-mix(in oklch,var(--accent) 10%,var(--card));}
.cf-review-request .rr-check-text{text-wrap:pretty;}
.cf-review-request .rr-box{flex:0 0 auto;display:grid;place-items:center;width:24px;height:24px;margin-top:1px;border-radius:6px;background:var(--field);border:2px solid color-mix(in oklch,var(--ink) 55%,var(--card));transition:background .16s ease,border-color .16s ease;}
.cf-review-request .rr-box svg{width:16px;height:16px;opacity:0;transform:scale(.6);transition:opacity .16s ease,transform .16s ease;}
.cf-review-request .rr-check input:checked + .rr-box{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));}
.cf-review-request .rr-check input:checked + .rr-box svg{opacity:1;transform:none;}
.cf-review-request .rr-check input:focus-visible + .rr-box{box-shadow:0 0 0 1px var(--card),0 0 0 4px var(--rr-focus);}
.cf-review-request .rr-fieldset:disabled .rr-check{cursor:not-allowed;color:var(--muted);}
.cf-review-request .rr-name{margin-top:16px;animation:rr-rise .45s cubic-bezier(.2,.7,.2,1) both;}
.cf-review-request .rr-label{display:block;margin:0 0 8px;font-size:17px;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink));}
.cf-review-request .rr-send{display:flex;flex-direction:column;align-items:stretch;gap:12px;width:100%;}
.cf-review-request .rr-send .rr-error{margin:0;}
.cf-review-request .rr-submit{--rr-btn:var(--button-bg,var(--cta));display:flex;align-items:center;justify-content:center;gap:10px;width:100%;margin-inline:auto;min-height:72px;padding:14px 24px;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.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--rr-btn) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));border:0;border-radius:var(--button-radius,var(--radius,12px));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rr-btn) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--rr-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--rr-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--rr-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease;}
.cf-review-request .rr-submit svg{flex:0 0 auto;width:20px;height:20px;}
.cf-review-request .rr-submit:hover:not(:disabled),.cf-review-request .rr-submit.is-hover:not(:disabled){transform:translateY(-1px);background:linear-gradient(oklch(from var(--rr-btn) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rr-btn) calc(l + .12) c h / .7),inset 0 -3px 0 oklch(from var(--rr-btn) calc(l - .2) c h),0 1px 2px oklch(from var(--rr-shadow) l c h / .32),0 12px 20px -6px oklch(from var(--rr-shadow) l c h / .5));}
.cf-review-request .rr-submit:active:not(:disabled),.cf-review-request .rr-submit.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--rr-btn) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--rr-btn) calc(l - .22) c h / .45),inset 0 -2px 0 oklch(from var(--rr-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--rr-shadow) l c h / .3);}
.cf-review-request .rr-submit:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:3px;}
.cf-review-request .rr-submit:disabled{background:color-mix(in oklch,var(--ink) 10%,var(--card));color:color-mix(in oklch,var(--ink) 62%,var(--card));text-shadow:none;box-shadow:none;transform:none;cursor:not-allowed;}
.cf-review-request .rr-submit[aria-busy=true]:disabled{background:linear-gradient(oklch(from var(--rr-btn) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);box-shadow:inset 0 -3px 0 oklch(from var(--rr-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--rr-shadow) l c h / .3);cursor:progress;}
.cf-review-request .rr-note{margin:0;font-size:15px;line-height:1.4;font-weight:500;color:var(--muted);text-align:center;text-wrap:pretty;}
.cf-review-request .rr-send .rr-error{text-align:center;}
.cf-review-request .rr-spin{animation:rr-spin .8s linear infinite;}
@media (max-width:640px){
.cf-review-request .rr-kit-thumbs img{width:56px;height:56px;}
.cf-review-request .rr-star{width:48px;height:48px;}
.cf-review-request .rr-star-face svg{width:38px;height:38px;}
.cf-review-request .rr-drop .rr-btn-2{width:100%;}
}
@keyframes rr-rise{from{opacity:.82;transform:translateY(8px);}to{opacity:1;transform:none;}}
@keyframes rr-pop{from{transform:scale(.9);}to{transform:scale(1);}}
@keyframes rr-spin{to{transform:rotate(360deg);}}
@media (prefers-reduced-motion:reduce){.cf-review-request *,.cf-review-request *::before,.cf-review-request *::after{animation:none !important;transition:none !important;}}
`;
pieces/forms/review-request/specimen.tsx 22 lines
import React from "react";
import ReviewRequest, { type ReviewRequestProps } from "../review-request";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error"];
export default function ReviewRequestSpecimen({ state = "default" }: { state?: string }) {
const sample = defaults.sample;
const items = sample.items.slice(0, 3).map((item, i) => ({
name: item.name,
image: slot("item-" + (i + 1), item.image),
imageAlt: item.imageAlt,
}));
return (
<ReviewRequest
state={state as ReviewRequestProps["state"]}
productName={sample.name.replace(/^The /, "")}
items={items}
/>
);
}
| Name | Type | Details |
|---|---|---|
productName OptionalReviewRequest |
string |
|
items OptionalReviewRequest |
ReviewRequestItem[] |
|
copy OptionalReviewRequest |
Partial<ReviewRequestCopy> |
|
minLength OptionalReviewRequest |
number |
|
maxPhotos OptionalReviewRequest |
number |
|
maxPhotoMB OptionalReviewRequest |
number |
|
submitting OptionalReviewRequest |
boolean |
|
onSubmit OptionalReviewRequest |
(values: ReviewRequestValues) => void |
|
state OptionalReviewRequest |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalReviewRequest |
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.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--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--field-border--field-focus--field-ink--field-radius- 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.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB