Review Request 4
Conversational review request on a lit stage: the product stands centred with short notes beside it, and one big question at a time (stars with a spring fill, the result, advice for a friend) builds a review the buyer checks and chooses to share before onSubmit.
Use it in a prompt
Use forms/review-request-4 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-4.tsx. - Import it and pass your copy and images (Props tab):
import { ReviewRequest4 } from "@/components/funneldna/forms/review-request-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/review-request-4/component.tsx 811 lines
// layout: product-stage
// Conversational review request on a lit stage: the product stands centred with short notes beside it, and one big question at a time (stars with a spring fill, the result, advice for a friend) builds a review the buyer checks and chooses to share before onSubmit.
import React, { useEffect, useId, useRef, useState } from 'react';
import { AnimatePresence, motion, useReducedMotion, type Variants } from 'motion/react';
import { AlertCircle, Check, Clock, Eye, Loader2, Lock, MessageSquareText, Star } from 'lucide-react';
import { Divider, FX_HOST, Glow } from '../fx/fx';
import torn from '../fx/dividers/torn';
export type ReviewRequest4Values = {
rating: number; // 1-5
ratingLabel: string;
result: string; // answer to the result question
advice: string; // what they would tell a friend
name: string; // how they want to be credited; may be empty when not shared
permission: boolean; // true only when they ticked the share box
};
export type ReviewRequest4Copy = {
headline: string; // {product}
salutation: string; // letter opener; '' hides it
letter: string; // {product}; '' hides it
signoff: string;
signName: string; // '' hides the name line
formLabel: string;
back: string;
stepOf: string; // {n}, {total}
progressAria: string; // {n}, {total}
q1: string; // {product}
q1Help: string;
ratingLabels: [string, string, string, string, string];
ratingPrompt: string;
ratingSay: string; // {n}, {label}
starAria: string; // {n}, {label}
ratingError: string; // {product}
q2: string; // {product}
q2Help: string;
resultPlaceholder: string;
q3: string; // {product}
q3Help: string;
advicePlaceholder: string;
startersLabel: string;
resultStarters: string[]; // shown with an ellipsis, inserted without it
adviceStarters: string[];
counterLeft: string; // {left}
counterLeftOne: string;
counterDone: string;
textError: string; // {min}
next: string;
toReview: string;
stepNote: string; // reassurance under the button on the question steps
q4: string; // {product}
q4Help: string;
reviewAria: string;
editLabel: string;
editRatingAria: string;
editResultAria: string;
editAdviceAria: string;
credit: string; // {name}
creditFallback: string;
nameLabel: string;
nameHelp: string;
namePlaceholder: string;
nameError: string;
permissionLabel: string; // {product}
button: string;
sending: string;
sharedNote: string; // under the button when the share box is ticked
privateNote: string; // under the button when it is not
};
export type ReviewRequest4Props = {
productName?: string; // used in the questions; the default reads 'us'
productImage?: string; // slot 'product': transparent cut-out shown on the stage
productAlt?: string;
notes?: string[]; // short reassurance notes set beside the product (up to 4)
copy?: Partial<ReviewRequest4Copy>;
minLength?: number; // characters needed in each written answer
submitting?: boolean; // loading button while the builder sends
onSubmit?: (values: ReviewRequest4Values) => void;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
};
const TOTAL = 4;
const NOTE_ICONS = [Clock, MessageSquareText, Eye, Lock];
export function ReviewRequest4(props: ReviewRequest4Props) {
const {
productName = 'us',
productImage,
productAlt = '',
notes = DEFAULT_NOTES,
copy,
minLength = 15,
submitting = false,
onSubmit,
state = 'default',
className,
} = props;
const c: ReviewRequest4Copy = { ...DEFAULT_COPY, ...copy };
const vars = { product: productName };
const uid = useId();
const id = (part: string) => uid + '-' + part;
const reduce = useReducedMotion() ?? false;
const seed = seedFor(state);
const [step, setStep] = useState(seed.step);
const [dir, setDir] = useState(1);
const [rating, setRating] = useState(seed.rating);
const [preview, setPreview] = useState<number | null>(seed.preview);
const [result, setResult] = useState('');
const [advice, setAdvice] = useState('');
const [name, setName] = useState('');
const [permission, setPermission] = useState(false);
const [tried, setTried] = useState<boolean[]>(seed.tried);
const starRefs = useRef<(HTMLButtonElement | null)[]>([]);
const resultRef = useRef<HTMLTextAreaElement>(null);
const adviceRef = useRef<HTMLTextAreaElement>(null);
const nameRef = useRef<HTMLInputElement>(null);
const timer = useRef<number | null>(null);
const moved = useRef(false);
useEffect(() => {
const next = seedFor(state);
setStep(next.step);
setRating(next.rating);
setPreview(next.preview);
setTried(next.tried);
setDir(1);
moved.current = false;
}, [state]);
useEffect(
() => () => {
if (timer.current !== null) window.clearTimeout(timer.current);
},
[]
);
const disabled = state === 'disabled';
const shown = preview ?? rating;
const labelOf = (n: number) => c.ratingLabels[n - 1] ?? '';
const resultLeft = Math.max(0, minLength - result.trim().length);
const adviceLeft = Math.max(0, minLength - advice.trim().length);
const nameMissing = permission && name.trim() === '';
const invalid = [rating === 0, resultLeft > 0, adviceLeft > 0, nameMissing];
const showError = (s: number) => tried[s] && invalid[s];
const list = notes.slice(0, 4);
const half = Math.ceil(list.length / 2);
const hasProduct = Boolean(productImage);
const hasLetter = Boolean(c.salutation || c.letter);
const btnClass = 'rr4-btn' + (state === 'hover' ? ' is-hover' : '') + (state === 'active' ? ' is-active' : '');
const counterOf = (left: number) =>
left === 0 ? c.counterDone : left === 1 ? c.counterLeftOne : fill(c.counterLeft, { left });
const slide: Variants = {
enter: (d: number) => ({ x: reduce ? 0 : d * 44, opacity: reduce ? 1 : 0 }),
center: { x: 0, opacity: 1 },
exit: (d: number) => ({ x: reduce ? 0 : d * -44, opacity: reduce ? 1 : 0 }),
};
function clearTimer() {
if (timer.current !== null) {
window.clearTimeout(timer.current);
timer.current = null;
}
}
function go(to: number) {
if (to < 0 || to >= TOTAL) return;
clearTimer();
setDir(to > step ? 1 : -1);
moved.current = true;
setPreview(null);
setStep(to);
}
function mark(s: number) {
setTried((list) => list.map((value, i) => (i === s ? true : value)));
}
function focusField(s: number) {
if (s === 0) starRefs.current[0]?.focus();
if (s === 1) resultRef.current?.focus();
if (s === 2) adviceRef.current?.focus();
if (s === 3) nameRef.current?.focus();
}
function advance() {
if (disabled) return;
if (invalid[step]) {
mark(step);
focusField(step);
return;
}
go(step + 1);
}
function pick(n: number, fromPointer: boolean) {
if (disabled) return;
setRating(n);
setPreview(null);
clearTimer();
if (fromPointer && step === 0) {
timer.current = window.setTimeout(
() => {
timer.current = null;
go(1);
},
reduce ? 160 : 520
);
}
}
function onStarKey(event: React.KeyboardEvent<HTMLButtonElement>, n: number) {
const keys: Record<string, number> = { ArrowRight: 1, ArrowUp: 1, ArrowLeft: -1, ArrowDown: -1 };
const delta = keys[event.key];
if (!delta) return;
event.preventDefault();
const to = Math.min(5, Math.max(1, n + delta));
pick(to, false);
starRefs.current[to - 1]?.focus();
}
function insertStarter(which: 'result' | 'advice', starter: string) {
const base = (which === 'result' ? result : advice).trimEnd();
const clean = (starter.endsWith('…') ? starter.slice(0, -1) : starter).trimEnd();
const next = (base ? base + ' ' : '') + clean + ' ';
(which === 'result' ? setResult : setAdvice)(next);
const ref = which === 'result' ? resultRef : adviceRef;
requestAnimationFrame(() => {
const el = ref.current;
if (!el) return;
el.focus();
el.setSelectionRange(next.length, next.length);
});
}
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
if (disabled || submitting) return;
if (step < TOTAL - 1) {
advance();
return;
}
if (nameMissing) {
mark(3);
nameRef.current?.focus();
return;
}
onSubmit?.({
rating,
ratingLabel: labelOf(rating),
result: result.trim(),
advice: advice.trim(),
name: name.trim(),
permission,
});
}
const focusHeading = (el: HTMLHeadingElement | null) => {
if (el && moved.current) {
moved.current = false;
el.focus({ preventScroll: true });
}
};
function starStep() {
const err = showError(0);
const focusable = rating || 1;
return (
<>
<h3 className='rr4-q' id={id('q')} ref={focusHeading} tabIndex={-1}>
{fill(c.q1, vars)}
</h3>
{c.q1Help ? <p className='rr4-help'>{c.q1Help}</p> : null}
<div
className='rr4-stars'
role='radiogroup'
aria-labelledby={id('q')}
aria-describedby={err ? id('rating-err') : undefined}
onPointerLeave={() => setPreview(null)}
>
{[1, 2, 3, 4, 5].map((n) => {
const on = n <= shown;
return (
<button
key={n}
ref={(el) => {
starRefs.current[n - 1] = el;
}}
type='button'
role='radio'
aria-checked={rating === n}
aria-label={fill(c.starAria, { n, label: labelOf(n) })}
tabIndex={n === focusable ? 0 : -1}
className={'rr4-star' + (on ? ' is-on' : '')}
onClick={(event) => pick(n, event.detail > 0)}
onPointerEnter={() => {
if (!disabled) setPreview(n);
}}
onKeyDown={(event) => onStarKey(event, n)}
>
<motion.span
className='rr4-star-ink'
initial={false}
animate={{ scale: on ? 1 : 0.84 }}
transition={
reduce
? { duration: 0 }
: { type: 'spring', stiffness: 520, damping: 12, delay: on ? (n - 1) * 0.04 : 0 }
}
>
<Star size={44} strokeWidth={2.5} aria-hidden='true' />
</motion.span>
</button>
);
})}
</div>
<p className='rr4-say' aria-live='polite'>
{shown ? fill(c.ratingSay, { n: shown, label: labelOf(shown) }) : c.ratingPrompt}
</p>
{err ? (
<p className='rr4-err' id={id('rating-err')} role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{fill(c.ratingError, vars)}
</p>
) : null}
</>
);
}
function textStep(which: 'result' | 'advice') {
const isResult = which === 'result';
const s = isResult ? 1 : 2;
const value = isResult ? result : advice;
const left = isResult ? resultLeft : adviceLeft;
const starters = isResult ? c.resultStarters : c.adviceStarters;
const help = isResult ? c.q2Help : c.q3Help;
const err = showError(s);
const fid = id(which);
return (
<>
<h3 className='rr4-q' id={id('q')} ref={focusHeading} tabIndex={-1}>
<label htmlFor={fid}>{fill(isResult ? c.q2 : c.q3, vars)}</label>
</h3>
{help ? (
<p className='rr4-help' id={id(which + '-help')}>
{help}
</p>
) : null}
{starters.length > 0 ? (
<div className='rr4-starters' role='group' aria-label={c.startersLabel}>
{starters.map((starter) => (
<button key={starter} type='button' className='rr4-chip' onClick={() => insertStarter(which, starter)}>
{starter}
</button>
))}
</div>
) : null}
<textarea
id={fid}
ref={isResult ? resultRef : adviceRef}
className='rr4-field rr4-area'
rows={4}
value={value}
placeholder={isResult ? c.resultPlaceholder : c.advicePlaceholder}
aria-invalid={err || undefined}
aria-describedby={[help ? id(which + '-help') : '', id(which + '-count'), err ? id(which + '-err') : '']
.filter(Boolean)
.join(' ')}
onChange={(event) => (isResult ? setResult : setAdvice)(event.target.value)}
/>
<p className={'rr4-meta' + (left === 0 ? ' is-done' : '')} id={id(which + '-count')}>
{left === 0 ? <Check size={16} strokeWidth={2.5} aria-hidden='true' /> : null}
{counterOf(left)}
</p>
{err ? (
<p className='rr4-err' id={id(which + '-err')} role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{fill(c.textError, { min: minLength })}
</p>
) : null}
</>
);
}
function reviewStep() {
const err = showError(3);
return (
<>
<h3 className='rr4-q' id={id('q')} ref={focusHeading} tabIndex={-1}>
{fill(c.q4, vars)}
</h3>
{c.q4Help ? <p className='rr4-help'>{c.q4Help}</p> : null}
<figure className='rr4-review' aria-label={c.reviewAria}>
<div className='rr4-row'>
<span className='rr4-mini' role='img' aria-label={fill(c.ratingSay, { n: rating, label: labelOf(rating) })}>
{[1, 2, 3, 4, 5].map((n) => (
<Star key={n} size={20} strokeWidth={2.5} className={n <= rating ? 'is-on' : ''} aria-hidden='true' />
))}
<span className='rr4-mini-label' aria-hidden='true'>
{labelOf(rating)}
</span>
</span>
<button type='button' className='rr4-edit' onClick={() => go(0)} aria-label={c.editRatingAria}>
{c.editLabel}
</button>
</div>
<div className='rr4-row'>
<blockquote className='rr4-quote'>
<p>“{result.trim()}”</p>
</blockquote>
<button type='button' className='rr4-edit' onClick={() => go(1)} aria-label={c.editResultAria}>
{c.editLabel}
</button>
</div>
<div className='rr4-row'>
<p className='rr4-advice'>{advice.trim()}</p>
<button type='button' className='rr4-edit' onClick={() => go(2)} aria-label={c.editAdviceAria}>
{c.editLabel}
</button>
</div>
<figcaption className='rr4-credit'>{fill(c.credit, { name: name.trim() || c.creditFallback })}</figcaption>
</figure>
<div className='rr4-name'>
<label className='rr4-label' htmlFor={id('name')}>
{c.nameLabel}
</label>
<input
id={id('name')}
ref={nameRef}
className='rr4-field rr4-input'
type='text'
autoComplete='name'
value={name}
placeholder={c.namePlaceholder}
aria-invalid={err || undefined}
aria-describedby={err ? id('name-err') : id('name-help')}
onChange={(event) => setName(event.target.value)}
/>
{err ? (
<p className='rr4-err' id={id('name-err')} role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{c.nameError}
</p>
) : (
<p className='rr4-small' id={id('name-help')}>
{c.nameHelp}
</p>
)}
</div>
<label className={'rr4-commit' + (permission ? ' is-on' : '')}>
<input type='checkbox' checked={permission} onChange={(event) => setPermission(event.target.checked)} />
<span className='rr4-box' aria-hidden='true'>
<Check size={18} strokeWidth={3} />
</span>
<span>{fill(c.permissionLabel, vars)}</span>
</label>
</>
);
}
const noteItem = (note: string, i: number) => {
const Icon = NOTE_ICONS[i % NOTE_ICONS.length];
return (
<li key={note + i} className='rr4-note'>
<Icon size={20} strokeWidth={2.5} aria-hidden='true' />
{note}
</li>
);
};
const stepBody = step === 0 ? starStep() : step === 1 ? textStep('result') : step === 2 ? textStep('advice') : reviewStep();
return (
<section
className={['cf-review-request-4', hasProduct ? '' : 'no-product', className].filter(Boolean).join(' ')}
style={FX_HOST}
aria-labelledby={id('title')}
>
<style>{CSS}</style>
<Glow />
<div className='rr4-wrap'>
<header className='rr4-head'>
<h2 className='rr4-title' id={id('title')}>
{fill(c.headline, vars)}
</h2>
{hasLetter ? (
<div className='rr4-letter'>
{c.salutation ? <p className='rr4-salute'>{c.salutation}</p> : null}
{c.letter ? <p>{fill(c.letter, vars)}</p> : null}
{c.signoff || c.signName ? (
<p className='rr4-sign'>
{c.signoff}
{c.signoff && c.signName ? <br /> : null}
{c.signName ? <strong>{c.signName}</strong> : null}
</p>
) : null}
</div>
) : null}
</header>
{hasProduct ? (
<div className='rr4-stage'>
{list.length > 0 ? (
<ul className='rr4-notes rr4-notes-side rr4-notes-l'>{list.slice(0, half).map((n, i) => noteItem(n, i))}</ul>
) : (
<span className='rr4-gap' />
)}
<div className='rr4-product'>
<span className='rr4-floor' aria-hidden='true' />
<img src={productImage} alt={productAlt} width={480} height={480} decoding='async' />
</div>
{list.length > 1 ? (
<ul className='rr4-notes rr4-notes-side rr4-notes-r'>{list.slice(half).map((n, i) => noteItem(n, i + half))}</ul>
) : (
<span className='rr4-gap' />
)}
</div>
) : null}
<form className='rr4-card' onSubmit={handleSubmit} noValidate>
<fieldset className='rr4-fs' disabled={disabled}>
<legend className='rr4-sr'>{c.formLabel}</legend>
<div className='rr4-top'>
<button
type='button'
className={'rr4-back' + (step === 0 ? ' is-gone' : '')}
onClick={() => go(step - 1)}
tabIndex={step === 0 ? -1 : undefined}
aria-hidden={step === 0 || undefined}
>
{c.back}
</button>
<div
className='rr4-track'
role='progressbar'
aria-label={c.formLabel}
aria-valuemin={1}
aria-valuemax={TOTAL}
aria-valuenow={step + 1}
aria-valuetext={fill(c.progressAria, { n: step + 1, total: TOTAL })}
>
<span className='rr4-fill' style={{ width: ((step + 1) / TOTAL) * 100 + '%' }} />
</div>
<span className='rr4-count' aria-hidden='true'>
{fill(c.stepOf, { n: step + 1, total: TOTAL })}
</span>
</div>
<div className='rr4-viewport'>
<AnimatePresence mode='wait' initial={false} custom={dir}>
<motion.div
key={step}
className='rr4-step'
custom={dir}
variants={slide}
initial='enter'
animate='center'
exit='exit'
transition={{ duration: reduce ? 0 : 0.24, ease: [0.2, 0.7, 0.2, 1] }}
>
{stepBody}
</motion.div>
</AnimatePresence>
</div>
<div className='rr4-actions'>
{step < TOTAL - 1 ? (
<button key='next' type='button' className={btnClass} onClick={advance}>
{step === TOTAL - 2 ? c.toReview : c.next}
</button>
) : (
<button key='send' type='submit' className={btnClass} disabled={submitting} aria-busy={submitting || undefined}>
{submitting ? (
<>
<Loader2 className='rr4-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
{c.sending}
</>
) : (
c.button
)}
</button>
)}
<p className='rr4-assure'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{step < TOTAL - 1 ? c.stepNote : permission ? c.sharedNote : c.privateNote}
</p>
</div>
</fieldset>
</form>
{list.length > 0 ? <ul className='rr4-notes rr4-foot'>{list.map((n, i) => noteItem(n, i))}</ul> : null}
</div>
<div className='rr4-edge' aria-hidden='true'>
<Divider shape='torn' src={torn} tone='surface' height={56} />
</div>
</section>
);
}
export default ReviewRequest4;
type Seed = { step: number; rating: number; preview: number | null; tried: boolean[] };
function seedFor(state: ReviewRequest4Props['state']): Seed {
const tried = [false, false, false, false];
if (state === 'error') return { step: 1, rating: 5, preview: null, tried: [false, true, false, false] };
if (state === 'hover') return { step: 0, rating: 0, preview: 4, tried };
if (state === 'active') return { step: 0, rating: 5, preview: null, tried };
return { step: 0, rating: 0, preview: null, tried };
}
function fill(template: string, values: Record<string, string | number>) {
let out = template;
for (const key of Object.keys(values)) out = out.split('{' + key + '}').join(String(values[key]));
return out;
}
const DEFAULT_NOTES = [
'About a minute from start to finish',
'One question at a time, in your own words',
'Read the whole review before it’s sent',
'Shared only if you tick the box',
];
const DEFAULT_COPY: ReviewRequest4Copy = {
headline: 'Got a minute? Tell us how it’s going.',
salutation: 'Hi there,',
letter: 'Your honest answers help us get better, and they help the next person decide. Four quick questions, one at a time.',
signoff: 'Thank you,',
signName: 'The team',
formLabel: 'Your review',
back: 'Back',
stepOf: '{n} of {total}',
progressAria: 'Question {n} of {total}',
q1: 'How many stars would you give {product}?',
q1Help: 'Tap a star. You can change it before you send.',
ratingLabels: ['Not for me', 'Could be better', 'It’s okay', 'Really good', 'Love it'],
ratingPrompt: 'Tap a star to rate',
ratingSay: '{n} of 5 stars: {label}',
starAria: '{n} of 5 stars, {label}',
ratingError: 'Tap a star to continue.',
q2: 'What’s one result you’ve had so far?',
q2Help: 'Small wins count. The more specific, the more useful.',
resultPlaceholder: 'I set it up in one evening and used it the very next morning.',
q3: 'What would you tell a friend who’s thinking about it?',
q3Help: 'One or two sentences, in your own words.',
advicePlaceholder: 'Start small and stick with it for a week. It adds up.',
startersLabel: 'Start your answer with',
resultStarters: ['The biggest change is…', 'Before, I…', 'Now I can…'],
adviceStarters: ['Start with…', 'Don’t skip…', 'It’s worth it if…'],
counterLeft: '{left} more characters',
counterLeftOne: '1 more character',
counterDone: 'Looks great',
textError: 'Add a few more words, at least {min} characters.',
next: 'Next question',
toReview: 'See my review',
stepNote: 'You’ll check the full review before anything is sent.',
q4: 'Here’s your review. Can we share it?',
q4Help: 'Read it through and change anything you like.',
reviewAria: 'Your review as it will appear',
editLabel: 'Edit',
editRatingAria: 'Edit your star rating',
editResultAria: 'Edit your result',
editAdviceAria: 'Edit your advice to a friend',
credit: '— {name}',
creditFallback: 'Your name',
nameLabel: 'Your name, as you’d like it shown',
nameHelp: 'First name and initial is plenty.',
namePlaceholder: 'Jamie L.',
nameError: 'Add the name to show with your review, or untick sharing below.',
permissionLabel: 'Yes, you can share this review with my name as shown.',
button: 'Send my review',
sending: 'Sending…',
sharedNote: 'We’ll share it exactly as you see it here.',
privateNote: 'Not ticked? Only our team will read it.',
};
const R = '.cf-review-request-4';
const CSS = `
${R}{--rr4-ring:oklch(from var(--field-focus,var(--accent)) l c h / .55);--rr4-b:var(--button-bg,var(--cta));--rr4-b2:var(--button-bg-2,var(--cta-2));--rr4-s:var(--shadow,oklch(0.22 0.03 260));position:relative;isolation:isolate;overflow:hidden;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) calc(clamp(64px,8.5vw,120px) + 56px);}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box;}
${R} .rr4-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;}
${R} .rr4-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}
${R} .rr4-head{max-width:46rem;margin:0 auto;text-align:center;}
${R} .rr4-title{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,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--band-ink);}
${R} .rr4-letter{margin:24px auto 0;max-width:38rem;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--band-ink);}
${R} .rr4-letter p{margin:0;text-wrap:pretty;}
${R} .rr4-letter p + p{margin-top:8px;}
${R} .rr4-letter .rr4-salute{font-weight:700;}
${R} .rr4-letter .rr4-sign{margin-top:12px;font-weight:500;}
${R} .rr4-sign strong{font-weight:800;}
${R} .rr4-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,280px) minmax(0,1fr);gap:clamp(24px,4vw,56px);align-items:center;margin-top:clamp(24px,3vw,40px);}
${R} .rr4-product{position:relative;display:flex;justify-content:center;align-items:flex-end;}
${R} .rr4-floor{position:absolute;left:4%;right:4%;bottom:2%;height:26%;border-radius:50%;background:radial-gradient(closest-side,oklch(from var(--accent-fill,var(--accent)) l c h / .4),oklch(from var(--accent-fill,var(--accent)) l c h / 0));}
${R} .rr4-product img{position:relative;display:block;width:100%;max-width:260px;height:auto;aspect-ratio:1/1;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--rr4-s) calc(l - 0.1) c h / .55)) drop-shadow(0 14px 14px oklch(from var(--rr4-s) calc(l - 0.1) c h / .4));}
${R} .rr4-notes{list-style:none;margin:0;padding:0;display:grid;gap:20px;}
${R} .rr4-notes-l{justify-self:end;text-align:right;max-width:20rem;}
${R} .rr4-notes-r{justify-self:start;max-width:20rem;}
${R} .rr4-note{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:600;color:var(--band-ink);text-wrap:pretty;}
${R} .rr4-note svg{display:inline-block;vertical-align:-0.2em;margin-inline-end:.45em;color:var(--band-ink);}
${R} .rr4-foot{display:none;max-width:680px;margin:28px auto 0;gap:12px;grid-template-columns:1fr;}
${R}.no-product .rr4-foot{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 32px;}
${R} .rr4-card{position:relative;max-width:680px;margin:-4px auto 0;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)));padding:clamp(20px,3vw,32px);}
${R}.no-product .rr4-card{margin-top:clamp(32px,4vw,48px);}
${R} .rr4-fs{border:0;margin:0;padding:0;min-width:0;display:flex;flex-direction:column;min-height:440px;}
${R} .rr4-top{display:flex;align-items:center;gap:12px;}
${R} .rr4-back{flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:.9375rem;line-height:1.15;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:pointer;transition:background .16s ease,transform .16s ease;}
${R} .rr4-back:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.04) c h);}
${R} .rr4-back:active{transform:translateY(1px);}
${R} .rr4-back:focus-visible{outline:3px solid var(--rr4-ring);outline-offset:2px;}
${R} .rr4-back.is-gone{display:none;}
${R} .rr4-track{flex:1;height:8px;border-radius:999px;background:color-mix(in oklch,var(--ink) 10%,var(--card));overflow:hidden;}
${R} .rr4-fill{display:block;height:100%;border-radius:inherit;background:var(--accent-fill,var(--accent));transition:width .45s cubic-bezier(.2,.7,.2,1);}
${R} .rr4-count{flex:none;font-size:.875rem;font-weight:800;line-height:1.2;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;}
${R} .rr4-viewport{flex:1;display:flex;flex-direction:column;overflow:hidden;margin:0 -6px;padding:28px 6px 6px;}
${R} .rr4-step{display:flex;flex-direction:column;}
${R} .rr4-q{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(1.75rem,2.9vw,2.5rem);line-height:1.1;text-wrap:balance;color:var(--ink);outline:none;}
${R} .rr4-q label{cursor:text;}
${R} .rr4-help{margin:12px 0 0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty;}
${R} .rr4-stars{display:flex;gap:8px;margin-top:28px;}
${R} .rr4-star{display:grid;place-items:center;width:64px;height:64px;padding:0;border:0;border-radius:var(--radius,12px);background:transparent;cursor:pointer;color:color-mix(in oklch,var(--ink) 38%,var(--card));transition:background .16s ease,color .16s ease;}
${R} .rr4-star:hover{background:color-mix(in oklch,var(--ink) 5%,var(--card));}
${R} .rr4-star:focus-visible{outline:3px solid var(--rr4-ring);outline-offset:2px;}
${R} .rr4-star:disabled{cursor:not-allowed;}
${R} .rr4-star-ink{display:grid;place-items:center;}
${R} .rr4-star svg{width:44px;height:44px;fill:transparent;transition:fill .16s ease;}
${R} .rr4-star.is-on{color:oklch(from var(--accent-fill,var(--accent)) calc(l - 0.14) c h);}
${R} .rr4-star.is-on svg{fill:var(--accent-fill,var(--accent));}
${R} .rr4-say{margin:16px 0 0;min-height:1.4em;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:700;color:var(--ink);}
${R} .rr4-starters{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px;}
${R} .rr4-chip{min-height:32px;padding:4px 12px;border-radius:999px;border:1px solid var(--button-2-border,transparent);background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));font-family:var(--font-body);font-size:.875rem;font-weight:800;line-height:1.2;cursor:pointer;transition:background .16s ease,transform .16s ease;}
${R} .rr4-chip:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.04) c h);}
${R} .rr4-chip:active{transform:translateY(1px);}
${R} .rr4-chip:focus-visible{outline:3px solid var(--rr4-ring);outline-offset:2px;}
${R} .rr4-chip:disabled{cursor:not-allowed;}
${R} .rr4-field{display:block;width:100%;margin-top:16px;background:var(--field,var(--card));color:var(--field-ink,var(--ink));border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));font-family:var(--font-body);font-size:1.0625rem;line-height:1.5;padding:14px 16px;transition:border-color .16s ease,box-shadow .16s ease;}
${R} .rr4-field::placeholder{color:color-mix(in oklch,var(--field-ink,var(--ink)) 65%,var(--field,var(--card)));opacity:1;}
${R} .rr4-field:hover{border-color:color-mix(in oklch,var(--ink) 38%,transparent);}
${R} .rr4-field:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35);}
${R} .rr4-field[aria-invalid='true']{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .2);}
${R} .rr4-field:disabled{background:color-mix(in oklch,var(--ink) 4%,var(--field,var(--card)));cursor:not-allowed;}
${R} .rr4-area{min-height:136px;resize:vertical;}
${R} .rr4-input{height:56px;margin-top:8px;padding:0 16px;}
${R} .rr4-meta{margin:8px 0 0;text-align:right;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);}
${R} .rr4-meta.is-done{color:var(--success);}
${R} .rr4-meta svg,${R} .rr4-err svg,${R} .rr4-assure svg{display:inline-block;vertical-align:-0.18em;margin-inline-end:.4em;}
${R} .rr4-err{margin:8px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty;}
${R} .rr4-review{margin:24px 0 0;padding:clamp(16px,2.4vw,24px);border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));display:grid;gap:16px;}
${R} .rr4-row{display:flex;align-items:flex-start;gap:16px;}
${R} .rr4-row > :first-child{flex:1;min-width:0;}
${R} .rr4-mini{display:flex;align-items:center;flex-wrap:wrap;gap:2px;}
${R} .rr4-mini svg{color:color-mix(in oklch,var(--ink) 35%,var(--card));fill:transparent;}
${R} .rr4-mini svg.is-on{color:oklch(from var(--accent-fill,var(--accent)) calc(l - 0.14) c h);fill:var(--accent-fill,var(--accent));}
${R} .rr4-mini-label{margin-inline-start:8px;font-size:.9375rem;font-weight:800;color:var(--ink);}
${R} .rr4-quote{margin:0;}
${R} .rr4-quote p{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.2;letter-spacing:-0.01em;color:var(--ink);overflow-wrap:anywhere;text-wrap:pretty;}
${R} .rr4-advice{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);overflow-wrap:anywhere;text-wrap:pretty;}
${R} .rr4-credit{font-size:.9375rem;font-weight:700;line-height:1.4;color:var(--ink);}
${R} .rr4-edit{flex:none;min-height:32px;padding:4px 2px;border:0;background:none;font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1.2;color:var(--link,var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / .45);text-underline-offset:.18em;cursor:pointer;}
${R} .rr4-edit:hover{color:oklch(from var(--link,var(--accent)) calc(l - 0.08) c h);text-decoration-color:currentColor;}
${R} .rr4-edit:focus-visible{outline:3px solid var(--rr4-ring);outline-offset:2px;border-radius:4px;}
${R} .rr4-name{margin-top:24px;}
${R} .rr4-label{display:block;font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink));}
${R} .rr4-small{margin:8px 0 0;font-size:.9375rem;line-height:1.4;color:var(--muted);}
${R} .rr4-commit{position:relative;display:flex;align-items:flex-start;gap:12px;margin-top:20px;padding:14px 16px;border-radius:var(--radius,12px);background:color-mix(in oklch,var(--ink) 4%,var(--card));font-size:1.0625rem;font-weight:600;line-height:1.4;color:var(--ink);cursor:pointer;transition:background .16s ease;}
${R} .rr4-commit:hover{background:color-mix(in oklch,var(--ink) 7%,var(--card));}
${R} .rr4-commit.is-on{background:color-mix(in oklch,var(--accent) 10%,var(--card));}
${R} .rr4-commit input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none;}
${R} .rr4-box{flex:none;display:grid;place-items:center;width:28px;height:28px;margin-top:-2px;border-radius:8px;background:var(--field,var(--card));border:2px solid color-mix(in oklch,var(--ink) 40%,transparent);color:transparent;transition:background .16s ease,border-color .16s ease;}
${R} .rr4-commit input:checked + .rr4-box{background:var(--accent-fill,var(--accent));border-color:oklch(from var(--accent-fill,var(--accent)) calc(l - 0.12) c h);color:var(--accent-fill-ink,var(--card));}
${R} .rr4-commit input:focus-visible + .rr4-box{outline:3px solid var(--rr4-ring);outline-offset:2px;}
${R} .rr4-fs:disabled .rr4-commit{cursor:not-allowed;}
${R} .rr4-actions{margin-top:24px;display:grid;gap:12px;}
${R} .rr4-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;padding:0 28px;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.55vw,1.375rem);line-height:1.15;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--rr4-b) calc(l + 0.04) c h),oklch(from var(--rr4-b2) calc(l - 0.02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rr4-b) calc(l + 0.14) c h / .7),inset 0 -3px 0 oklch(from var(--rr4-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rr4-s) l c h / .3),0 8px 16px -6px oklch(from var(--rr4-s) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease;}
${R} .rr4-btn:hover:not(:disabled),${R} .rr4-btn.is-hover{background:linear-gradient(oklch(from var(--rr4-b) calc(l - 0.01) c h),oklch(from var(--rr4-b2) calc(l - 0.07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rr4-b) calc(l + 0.1) c h / .6),inset 0 -3px 0 oklch(from var(--rr4-b) calc(l - 0.2) c h),0 1px 2px oklch(from var(--rr4-s) l c h / .32),0 10px 18px -6px oklch(from var(--rr4-s) l c h / .55));}
${R} .rr4-btn:active:not(:disabled),${R} .rr4-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--rr4-b) calc(l - 0.04) c h),oklch(from var(--rr4-b2) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--rr4-b2) calc(l - 0.2) c h / .55),inset 0 -2px 0 oklch(from var(--rr4-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rr4-s) l c h / .3);}
${R} .rr4-btn:focus-visible{outline:3px solid var(--rr4-ring);outline-offset:3px;}
${R} .rr4-btn[aria-busy='true']{cursor:progress;}
${R} .rr4-fs:disabled .rr4-btn{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));transform:none;cursor:not-allowed;}
${R} .rr4-fs:disabled .rr4-star,${R} .rr4-fs:disabled .rr4-back{opacity:.6;}
${R} .rr4-assure{margin:0;text-align:center;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-wrap:pretty;}
@keyframes rr4-spin{to{transform:rotate(360deg);}}
${R} .rr4-spin{animation:rr4-spin .8s linear infinite;}
${R} .rr4-edge{position:absolute;left:0;right:0;bottom:0;height:56px;z-index:1;pointer-events:none;}
@media (max-width:899px){
${R} .rr4-stage{grid-template-columns:1fr;gap:0;}
${R} .rr4-notes-side,${R} .rr4-stage > .rr4-gap{display:none;}
${R} .rr4-foot{display:grid;}
${R} .rr4-product img{max-width:200px;}
}
@media (max-width:560px){
${R} .rr4-fs{min-height:0;}
${R}.no-product .rr4-foot{grid-template-columns:1fr;gap:12px;}
${R} .rr4-letter{margin-top:16px;}
${R} .rr4-product img{max-width:168px;}
${R} .rr4-stars{gap:2px;justify-content:space-between;}
${R} .rr4-star{width:56px;height:56px;}
${R} .rr4-star svg{width:38px;height:38px;}
${R} .rr4-viewport{padding-top:24px;}
${R} .rr4-chip{min-height:36px;}
${R} .rr4-row{gap:12px;}
}
@media (prefers-reduced-motion:reduce){
${R} .rr4-fill,${R} .rr4-btn,${R} .rr4-star,${R} .rr4-star svg,${R} .rr4-field,${R} .rr4-chip,${R} .rr4-back,${R} .rr4-commit,${R} .rr4-box{transition:none;}
${R} .rr4-spin{animation:none;}
${R} .rr4-btn:active:not(:disabled),${R} .rr4-btn.is-active,${R} .rr4-back:active,${R} .rr4-chip:active{transform:none;}
}
`;
pieces/forms/review-request-4/specimen.tsx 43 lines
import __studioImagef67464a8 from "../assets/1aa7f98e847cda7b.webp";
import React from 'react';
import { ReviewRequest4, type ReviewRequest4Props } from '../review-request-4';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
export default function ReviewRequest4Specimen({ state = 'default' }: { state?: ReviewRequest4Props['state'] }) {
return (
<ReviewRequest4
state={state}
productName='Northpaw'
productImage={slot(
'product',
__studioImagef67464a8
)}
productAlt='The Northpaw training app open on a phone'
notes={[
'About a minute, start to finish',
'Answer in your own words, one question at a time',
'Read the whole review before it’s sent',
'Shared only if you tick the box',
]}
copy={{
headline: 'How’s training going with Northpaw?',
salutation: 'Dear friend,',
letter: 'You’ve had a few weeks of daily sessions with Northpaw. I’d love to hear how it’s really going, the wins and the bumps. Four short questions, one at a time.',
signoff: 'Thanks for helping us get better,',
signName: 'Maya, founder of Northpaw',
q2: 'What does your dog do better since you started Northpaw?',
q2Help: 'Small wins count. The more specific, the more it helps other owners.',
resultPlaceholder: 'Biscuit finally comes back when I call him at the park, even with other dogs around.',
resultStarters: ['She finally…', 'Walks used to be…', 'I didn’t expect…'],
q3: 'What would you tell a friend who’s thinking about trying Northpaw?',
advicePlaceholder: 'Do the five-minute sessions every day. They add up faster than you think.',
q4: 'Here’s your review. Okay to share it?',
namePlaceholder: 'Dana R., Austin',
permissionLabel: 'Yes, Northpaw can share this review with my name as shown.',
privateNote: 'Not ticked? Only the Northpaw team will read it.',
}}
/>
);
}
| Name | Type | Details |
|---|---|---|
productName OptionalReviewRequest4 |
string |
|
productImage OptionalReviewRequest4 |
string |
|
productAlt OptionalReviewRequest4 |
string |
|
notes OptionalReviewRequest4 |
string[] |
|
copy OptionalReviewRequest4 |
Partial<ReviewRequest4Copy> |
|
minLength OptionalReviewRequest4 |
number |
|
submitting OptionalReviewRequest4 |
boolean |
|
onSubmit OptionalReviewRequest4 |
(values: ReviewRequest4Values) => void |
|
state OptionalReviewRequest4 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
className OptionalReviewRequest4 |
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.
product- The main product shot or cover (ebook, kit, bottle).
-
1aa7f98e847cda7b.webp
image/webp · 61.8 KB
-
9a2ebdab5ff4fcc4.webp
image/webp · 3.64 KB