Comment Stack 1
Comment stack: a threaded member discussion that makes the community feel real and answered. It opens on three threads behind a soft fade, a segmented reading meter shows how much is left, and "Read more comments" expands the stack in place before the action.
Use it in a prompt
Use proof/comment-stack 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/comment-stack.tsx. - Import it and pass your copy and images (Props tab):
import { CommentStack } from "@/components/funneldna/proof/comment-stack"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/proof/comment-stack/component.tsx 608 lines
// layout: segmented-stepper
// Comment stack: a threaded member discussion that makes the community feel real and answered. It opens on three threads behind a soft fade, a segmented reading meter shows how much is left, and "Read more comments" expands the stack in place before the action.
import React from "react";
import { ThumbsUp, UserRound, Users } from "lucide-react";
import { Backdrop, Spot, FX_HOST } from "../fx/fx";
import workshop from "../fx/backdrops/workshop";
import community from "../fx/spots/community";
export type CommentStackReply = {
/** Who replied (usually the host). */
name?: string;
/** Avatar image URL; initials show when omitted. */
avatar?: string;
/** Relative date label exactly as supplied, e.g. "2 days ago". */
date?: string;
text: string;
/** Marks the reply as the host's (default true). */
host?: boolean;
/** Overrides the host chip label for this reply. */
label?: string;
};
export type CommentStackThread = {
id?: string;
name?: string;
/** Avatar image URL; initials show when omitted. */
avatar?: string;
/** Relative date label exactly as supplied. */
date?: string;
text: string;
/** "Helpful" count; shown only when supplied and above zero. */
helpful?: number;
/** One nested reply, drawn under the comment on a thread line. */
reply?: CommentStackReply;
};
export type CommentStackCopy = {
/** Expand button label. */
moreLabel: string;
/** Count chip in the expand button; {count} = hidden threads. */
moreCount: string;
/** Meter line while collapsed; {shown} and {total}. */
showing: string;
/** Meter line once every thread shows; {total}. */
showingAll: string;
helpfulOne: string;
/** {count} = supplied helpful count. */
helpfulMany: string;
hostLabel: string;
/** {count} = supplied member count. */
membersLabel: string;
};
export type CommentStackProps = {
headline?: React.ReactNode;
/** Phrase inside a string headline that gets the marker stroke. */
highlight?: string;
lead?: string;
/** Threads to show; the section renders nothing when empty. */
comments?: CommentStackThread[];
/** Community name for the side column; shown only when supplied. */
groupName?: string;
/** Member count as supplied, e.g. "1,240"; shown only when supplied. */
memberCount?: string;
/** Threads visible before "Read more comments". */
initialCount?: number;
/** Primary action label; empty hides the button. */
actionLabel?: string;
/** One short line under the button. */
actionNote?: string;
href?: string;
onAction?: () => void;
/** Backdrop photo (an fx backdrop asset); the page's scene image replaces it. */
backdropImage?: string;
/** Start with every thread open. */
defaultExpanded?: boolean;
state?: "default" | "hover" | "active" | "disabled";
className?: string;
copy?: Partial<CommentStackCopy>;
};
const DEFAULT_COPY: CommentStackCopy = {
moreLabel: "Read more comments",
moreCount: "{count} more",
showing: "Showing {shown} of {total} conversations",
showingAll: "Showing all {total} conversations",
helpfulOne: "1 person found this helpful",
helpfulMany: "{count} people found this helpful",
hostLabel: "Host",
membersLabel: "{count} members",
};
export function CommentStack(props: CommentStackProps) {
const {
headline = "Hear it from the people already inside",
highlight = "already inside",
lead = "See what members ask, and how the host answers.",
comments = [],
groupName,
memberCount,
initialCount = 3,
actionLabel = "Join the conversation",
actionNote,
href,
onAction,
backdropImage = workshop,
defaultExpanded = false,
state = "default",
className,
copy: copyProp,
} = props;
const copy = { ...DEFAULT_COPY, ...copyProp };
const uid = React.useId();
const headingId = uid + "-title";
const listId = uid + "-list";
const [expanded, setExpanded] = React.useState(defaultExpanded);
const focusIndex = React.useRef<number | null>(null);
const itemRefs = React.useRef<(HTMLElement | null)[]>([]);
const threads = (comments || []).filter(
(t) => t && typeof t.text === "string" && t.text.trim().length > 0
);
const total = threads.length;
const limit = Math.max(1, Math.floor(initialCount || 3));
const hasMore = total > limit;
const open = expanded || !hasMore;
const shown = open ? total : limit;
const disabled = state === "disabled";
React.useEffect(() => {
if (expanded && focusIndex.current !== null) {
itemRefs.current[focusIndex.current]?.focus({ preventScroll: true });
focusIndex.current = null;
}
}, [expanded]);
if (total === 0) return null;
const expand = () => {
if (disabled) return;
focusIndex.current = limit;
setExpanded(true);
};
const meterText = open
? copy.showingAll.replace("{total}", String(total))
: copy.showing.replace("{shown}", String(shown)).replace("{total}", String(total));
const ctaClass = "cf-comment-stack__cta";
const cta = !actionLabel ? null : href ? (
<a
className={ctaClass}
href={disabled ? undefined : href}
aria-disabled={disabled || undefined}
onClick={(e) => {
if (disabled) {
e.preventDefault();
return;
}
onAction?.();
}}
>
{actionLabel}
</a>
) : (
<button type="button" className={ctaClass} disabled={disabled} onClick={() => onAction?.()}>
{actionLabel}
</button>
);
const showGroup = Boolean(groupName || memberCount);
return (
<section
className={["cf-comment-stack", className].filter(Boolean).join(" ")}
data-state={state}
aria-labelledby={headingId}
style={FX_HOST}
>
<Backdrop src={backdropImage} treatment="scrim-dark" position="center" />
<div className="cf-comment-stack__inner">
<div className="cf-comment-stack__intro">
<h2 id={headingId} className="cf-comment-stack__title">
{renderHeadline(headline, highlight)}
</h2>
{lead ? <p className="cf-comment-stack__lede">{lead}</p> : null}
{showGroup ? (
<div className="cf-comment-stack__group">
<Spot src={community} size={64} shade="band" light="band-ink" />
<div className="cf-comment-stack__group-copy">
{groupName ? <p className="cf-comment-stack__group-name">{groupName}</p> : null}
{memberCount ? (
<p className="cf-comment-stack__group-count">
<Users className="cf-comment-stack__inline-icon" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.membersLabel.replace("{count}", memberCount)}
</p>
) : null}
</div>
</div>
) : null}
</div>
<div className="cf-comment-stack__stack">
{hasMore ? (
<div className="cf-comment-stack__meter">
<p className="cf-comment-stack__meter-text" aria-live="polite">
{meterText}
</p>
{total <= 16 ? (
<div className="cf-comment-stack__segs" aria-hidden="true">
{threads.map((t, i) => (
<span key={t.id ?? i} className={"cf-comment-stack__seg" + (i < shown ? " is-on" : "")} />
))}
</div>
) : (
<div className="cf-comment-stack__bar" aria-hidden="true">
<span style={{ width: Math.round((shown / total) * 100) + "%" }} />
</div>
)}
</div>
) : null}
<ol id={listId} className={"cf-comment-stack__list" + (open ? "" : " is-faded")}>
{threads.slice(0, shown).map((t, i) => {
const reply = t.reply && typeof t.reply.text === "string" && t.reply.text.trim() ? t.reply : undefined;
const isHostReply = reply ? reply.host !== false : false;
const helpful =
typeof t.helpful === "number" && Number.isFinite(t.helpful) && t.helpful > 0 ? t.helpful : 0;
const delay = i < limit ? i : i - limit;
return (
<li
key={t.id ?? i + "-" + (t.name ?? "")}
className="cf-comment-stack__item"
style={{ ["--cs-i" as string]: delay } as React.CSSProperties}
>
<article
ref={(el) => {
itemRefs.current[i] = el;
}}
tabIndex={-1}
className="cf-comment-stack__thread"
>
<div className="cf-comment-stack__grid">
<div className="cf-comment-stack__rail">
<Avatar name={t.name} src={t.avatar} />
{reply ? <span className="cf-comment-stack__line" aria-hidden="true" /> : null}
</div>
<div className="cf-comment-stack__body">
{t.name || t.date ? (
<div className="cf-comment-stack__meta">
{t.name ? <span className="cf-comment-stack__name">{t.name}</span> : null}
{t.date ? <span className="cf-comment-stack__date">{t.date}</span> : null}
</div>
) : null}
<p className="cf-comment-stack__text">{t.text}</p>
{helpful ? (
<p className="cf-comment-stack__helpful">
<ThumbsUp className="cf-comment-stack__inline-icon" size={16} strokeWidth={2.5} aria-hidden="true" />
{helpful === 1 ? copy.helpfulOne : copy.helpfulMany.replace("{count}", String(helpful))}
</p>
) : null}
</div>
{reply ? (
<>
<div className="cf-comment-stack__elbow" aria-hidden="true" />
<div className="cf-comment-stack__reply">
<div className="cf-comment-stack__reply-box">
<Avatar name={reply.name} src={reply.avatar} host={isHostReply} small />
<div className="cf-comment-stack__reply-body">
<div className="cf-comment-stack__meta is-small">
{reply.name ? <span className="cf-comment-stack__name">{reply.name}</span> : null}
{isHostReply || reply.label ? (
<span className="cf-comment-stack__chip">{reply.label || copy.hostLabel}</span>
) : null}
{reply.date ? <span className="cf-comment-stack__date">{reply.date}</span> : null}
</div>
<p className="cf-comment-stack__text">{reply.text}</p>
</div>
</div>
</div>
</>
) : null}
</div>
</article>
</li>
);
})}
</ol>
{!open ? (
<button
type="button"
className="cf-comment-stack__more"
aria-expanded={false}
aria-controls={listId}
onClick={expand}
disabled={disabled}
>
<span>{copy.moreLabel}</span>
<span className="cf-comment-stack__more-count">
{copy.moreCount.replace("{count}", String(total - limit))}
</span>
</button>
) : null}
</div>
{cta ? (
<div className="cf-comment-stack__action">
{cta}
{actionNote ? <p className="cf-comment-stack__note">{actionNote}</p> : null}
</div>
) : null}
</div>
<style>{CSS}</style>
</section>
);
}
export default CommentStack;
function renderHeadline(headline: React.ReactNode, highlight?: string) {
if (typeof headline !== "string" || !highlight) return headline;
const at = headline.indexOf(highlight);
if (at < 0) return headline;
return (
<>
{headline.slice(0, at)}
<span className="cf-comment-stack__mark">{highlight}</span>
{headline.slice(at + highlight.length)}
</>
);
}
function initialsOf(name?: string) {
if (!name) return "";
const parts = name.trim().split(" ").filter(Boolean);
if (!parts.length) return "";
const first = parts[0].charAt(0);
const last = parts.length > 1 ? parts[parts.length - 1].charAt(0) : "";
return (first + last).toUpperCase();
}
function Avatar({ name, src, host, small }: { name?: string; src?: string; host?: boolean; small?: boolean }) {
const cls = ["cf-comment-stack__avatar", small ? "is-small" : "", host ? "is-host" : ""].filter(Boolean).join(" ");
if (src) {
const size = small ? 36 : 44;
return <img className={cls} src={src} alt="" width={size} height={size} loading="lazy" decoding="async" />;
}
const initials = initialsOf(name);
return (
<span className={cls} aria-hidden="true">
{initials || <UserRound size={small ? 16 : 20} strokeWidth={2.5} />}
</span>
);
}
const CSS = `
.cf-comment-stack, .cf-comment-stack *, .cf-comment-stack *::before, .cf-comment-stack *::after { box-sizing: border-box; }
.cf-comment-stack {
--cs-line: oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / 0.2);
--cs-shadow: var(--shadow, oklch(0.22 0.03 256));
--av: 44px; --rav: 36px; --gap: 16px; --rp: 14px;
position: relative;
overflow: hidden;
background: var(--band, oklch(0.27 0.067 256));
color: var(--band-ink, #fff);
font-family: var(--font-body, system-ui, sans-serif);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-comment-stack__inner {
position: relative; z-index: 1;
max-width: 1120px; margin: 0 auto;
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 40rem);
grid-template-rows: auto 1fr;
grid-template-areas: 'intro stack' 'action stack';
column-gap: clamp(32px, 5vw, 72px);
row-gap: 32px;
align-items: start;
}
.cf-comment-stack__intro { grid-area: intro; min-width: 0; }
.cf-comment-stack__stack { grid-area: stack; min-width: 0; }
.cf-comment-stack__action { grid-area: action; display: grid; justify-items: start; gap: 12px; min-width: 0; }
.cf-comment-stack__title {
margin: 0 0 16px;
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;
text-wrap: balance;
color: var(--band-ink, #fff);
}
.cf-comment-stack__mark {
background-image: linear-gradient(transparent 76%, var(--marker, #fae37c) 76%, var(--marker, #fae37c) 95%, transparent 95%);
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
padding: 0 0.06em;
}
.cf-comment-stack__lede {
margin: 0 0 32px;
max-width: 44ch;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.4;
font-weight: 500;
text-wrap: pretty;
color: var(--band-ink, #fff);
}
.cf-comment-stack__group { display: flex; align-items: center; gap: 16px; }
.cf-comment-stack__group-copy { min-width: 0; }
.cf-comment-stack__group-name {
margin: 0 0 4px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
text-wrap: balance;
color: var(--band-ink, #fff);
}
.cf-comment-stack__group-count { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--band-ink, #fff); }
.cf-comment-stack__inline-icon { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; flex: none; }
.cf-comment-stack__meter { margin: 0 0 16px; }
.cf-comment-stack__meter-text { margin: 0 0 12px; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--band-ink, #fff); }
.cf-comment-stack__segs { display: flex; gap: 4px; }
.cf-comment-stack__seg { flex: 1 1 0; height: 6px; border-radius: 999px; background: oklch(from var(--band-ink, #fff) l c h / 0.24); transition: background-color 0.3s ease; }
.cf-comment-stack__seg.is-on { background: var(--band-ink, #fff); }
.cf-comment-stack__bar { height: 6px; border-radius: 999px; overflow: hidden; background: oklch(from var(--band-ink, #fff) l c h / 0.24); }
.cf-comment-stack__bar > span { display: block; height: 100%; border-radius: inherit; background: var(--band-ink, #fff); transition: width 0.3s ease; }
.cf-comment-stack__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cf-comment-stack__list.is-faded {
-webkit-mask-image: linear-gradient(to bottom, var(--ink, oklch(0.21 0.034 263)) calc(100% - 7rem), transparent 100%);
mask-image: linear-gradient(to bottom, var(--ink, oklch(0.21 0.034 263)) calc(100% - 7rem), transparent 100%);
}
.cf-comment-stack__item { animation: cf-cs-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: min(calc(var(--cs-i, 0) * 0.07s), 0.28s); }
@keyframes cf-cs-rise { from { opacity: 0.82; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cf-comment-stack__thread {
background: var(--card, #fff);
color: var(--ink, oklch(0.21 0.034 263));
border: 1px solid var(--card-border, oklch(from var(--ink, oklch(0.21 0.034 263)) 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(--cs-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--cs-shadow) l c h / 0.2)));
padding: clamp(20px, 3vw, 32px);
outline: none;
}
.cf-comment-stack__thread:focus-visible { outline: 3px solid var(--band-ink, #fff); outline-offset: 3px; }
.cf-comment-stack__grid { display: grid; grid-template-columns: var(--av) minmax(0, 1fr); column-gap: var(--gap); row-gap: 0; }
.cf-comment-stack__rail { display: flex; flex-direction: column; align-items: center; }
.cf-comment-stack__line { flex: 1 1 auto; width: 2px; min-height: 8px; margin-top: 8px; border-radius: 2px; background: var(--cs-line); }
.cf-comment-stack__body { min-width: 0; }
.cf-comment-stack__avatar {
width: var(--av); height: var(--av); flex: none;
border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
object-fit: cover; object-position: center 30%;
font-family: var(--font-body, inherit);
font-size: 1rem; font-weight: 800; line-height: 1;
background: var(--secondary, oklch(0.93 0.015 263));
color: var(--secondary-ink, var(--ink, oklch(0.21 0.034 263)));
}
.cf-comment-stack__avatar.is-small { width: var(--rav); height: var(--rav); font-size: 0.875rem; }
.cf-comment-stack__avatar.is-host { background: var(--accent-fill, var(--accent, oklch(0.5 0.17 257))); color: var(--accent-fill-ink, var(--card, #fff)); }
img.cf-comment-stack__avatar { background: var(--secondary, oklch(0.93 0.015 263)); }
.cf-comment-stack__meta { min-height: var(--av); display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; }
.cf-comment-stack__meta.is-small { min-height: var(--rav); }
.cf-comment-stack__name { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; color: var(--ink, oklch(0.21 0.034 263)); }
.cf-comment-stack__date { font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted, oklch(0.45 0.03 258)); }
.cf-comment-stack__text {
margin: 4px 0 0;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.55;
text-wrap: pretty;
overflow-wrap: anywhere;
color: var(--ink, oklch(0.21 0.034 263));
}
.cf-comment-stack__body > .cf-comment-stack__text:first-child { padding-top: 10px; margin-top: 0; }
.cf-comment-stack__helpful { margin: 12px 0 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted, oklch(0.45 0.03 258)); }
.cf-comment-stack__elbow { position: relative; }
.cf-comment-stack__elbow::before {
content: '';
position: absolute; top: 0;
left: calc(var(--av) / 2 - 1px);
width: calc(var(--av) / 2 + var(--gap) + 1px);
height: calc(20px + var(--rp) + var(--rav) / 2);
border-left: 2px solid var(--cs-line);
border-bottom: 2px solid var(--cs-line);
border-bottom-left-radius: 14px;
}
.cf-comment-stack__reply { grid-column: 2; padding-top: 20px; min-width: 0; }
.cf-comment-stack__reply-box {
display: grid; grid-template-columns: var(--rav) minmax(0, 1fr); column-gap: 12px;
padding: var(--rp) 16px;
border-radius: 10px;
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 4%, var(--card, #fff));
}
.cf-comment-stack__reply-body { min-width: 0; }
.cf-comment-stack__chip {
display: inline-flex; align-items: center;
min-height: 24px; padding: 3px 12px;
border-radius: 999px;
font-size: 0.875rem; line-height: 1.2; font-weight: 800;
background: var(--accent-fill, var(--accent, oklch(0.5 0.17 257)));
color: var(--accent-fill-ink, var(--card, #fff));
}
.cf-comment-stack__more {
margin-top: 16px; width: 100%; min-height: 56px;
display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px;
padding: 8px 28px;
border-radius: var(--button-radius, var(--radius, 12px));
border: 1px solid var(--button-2-border, transparent);
background:
linear-gradient(var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263))), var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)))),
var(--card, #fff);
color: var(--button-2-ink, var(--secondary-ink, var(--ink, oklch(0.21 0.034 263))));
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;
box-shadow: var(--button-2-shadow, var(--shadow-sm, 0 1px 1px oklch(from var(--cs-shadow) l c h / 0.18), 0 1px 3px oklch(from var(--cs-shadow) l c h / 0.14)));
cursor: pointer;
transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
.cf-comment-stack__more:hover:not(:disabled), .cf-comment-stack[data-state='hover'] .cf-comment-stack__more:not(:disabled) {
background:
linear-gradient(oklch(from var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263))) calc(l - 0.04) c h / alpha), oklch(from var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263))) calc(l - 0.04) c h / alpha)),
oklch(from var(--card, #fff) calc(l - 0.04) c h);
}
.cf-comment-stack__more:active:not(:disabled), .cf-comment-stack[data-state='active'] .cf-comment-stack__more:not(:disabled) {
transform: translateY(1px);
box-shadow: inset 0 2px 3px oklch(from var(--cs-shadow) l c h / 0.25);
}
.cf-comment-stack__more:focus-visible { outline: 3px solid var(--band-ink, #fff); outline-offset: 3px; }
.cf-comment-stack__more:disabled { cursor: not-allowed; opacity: 0.62; box-shadow: none; }
.cf-comment-stack__more-count {
display: inline-flex; align-items: center;
min-height: 28px; padding: 4px 12px; border-radius: 999px;
font-family: var(--font-body, inherit); font-size: 0.875rem; line-height: 1.2; font-weight: 800;
background: oklch(from var(--button-2-ink, var(--secondary-ink, var(--ink, oklch(0.21 0.034 263)))) l c h / 0.1);
}
.cf-comment-stack__cta {
--cs-bg: var(--button-bg, var(--cta, oklch(0.58 0.21 29)));
display: inline-flex; align-items: center; justify-content: center; text-align: center;
width: 100%; max-width: 26rem; min-height: 64px; padding: 10px 28px;
border: 0; text-decoration: none; cursor: pointer;
border-radius: var(--button-radius, var(--radius, 12px));
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;
text-wrap: balance;
color: var(--button-ink, var(--cta-ink, #fff));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--cs-bg) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2, var(--cs-bg))) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--cs-bg) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--cs-bg) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--cs-shadow) l c h / 0.35), 0 8px 16px -6px oklch(from var(--cs-shadow) l c h / 0.45));
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-comment-stack__cta:hover:not(:disabled):not([aria-disabled='true']), .cf-comment-stack[data-state='hover'] .cf-comment-stack__cta:not(:disabled) {
background: linear-gradient(oklch(from var(--cs-bg) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2, var(--cs-bg))) calc(l - 0.07) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--cs-bg) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--cs-bg) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--cs-shadow) l c h / 0.4), 0 10px 18px -6px oklch(from var(--cs-shadow) l c h / 0.55));
}
.cf-comment-stack__cta:active:not(:disabled):not([aria-disabled='true']), .cf-comment-stack[data-state='active'] .cf-comment-stack__cta:not(:disabled) {
transform: translateY(1px);
box-shadow: inset 0 2px 4px oklch(from var(--cs-shadow) l c h / 0.35), inset 0 -2px 0 oklch(from var(--cs-bg) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--cs-shadow) l c h / 0.3);
}
.cf-comment-stack__cta:focus-visible { outline: 3px solid var(--band-ink, #fff); outline-offset: 3px; }
.cf-comment-stack__cta:disabled, .cf-comment-stack__cta[aria-disabled='true'] {
cursor: not-allowed;
background: var(--secondary, oklch(0.93 0.015 263));
color: var(--secondary-ink, var(--ink, oklch(0.21 0.034 263)));
text-shadow: none; box-shadow: none; opacity: 0.8;
}
.cf-comment-stack__note { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; text-wrap: pretty; color: var(--band-ink, #fff); }
@media (max-width: 900px) {
.cf-comment-stack__inner {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto;
grid-template-areas: 'intro' 'stack' 'action';
}
.cf-comment-stack__lede { margin-bottom: 24px; }
.cf-comment-stack__action { justify-items: stretch; }
.cf-comment-stack__cta { max-width: none; }
}
@media (max-width: 480px) {
.cf-comment-stack { --av: 40px; --rav: 32px; --gap: 12px; --rp: 12px; }
.cf-comment-stack__thread { padding: 20px; }
.cf-comment-stack__reply-box { padding: var(--rp) 12px; column-gap: 10px; }
.cf-comment-stack__reply-body { display: contents; }
.cf-comment-stack__reply-body > .cf-comment-stack__meta { grid-column: 2; }
.cf-comment-stack__reply-body > .cf-comment-stack__text { grid-column: 1 / -1; margin-top: 8px; font-size: 1rem; }
.cf-comment-stack__more { padding: 8px 20px; }
}
@media (prefers-reduced-motion: reduce) {
.cf-comment-stack__item { animation: none; }
.cf-comment-stack__seg, .cf-comment-stack__bar > span, .cf-comment-stack__more, .cf-comment-stack__cta { transition: none; }
.cf-comment-stack__more:active:not(:disabled), .cf-comment-stack__cta:active:not(:disabled) { transform: none; }
}
`;
pieces/proof/comment-stack/specimen.tsx 96 lines
// Specimen: the Kiln & Co. members' group talking through wheel classes, glazing and firing, with the studio host replying.
import React from "react";
import CommentStack from "../comment-stack";
import type { CommentStackThread } from "../comment-stack";
export const states = ["default", "hover", "active", "disabled"];
type SpecimenState = "default" | "hover" | "active" | "disabled";
const HOST = "Maren O.";
const threads: CommentStackThread[] = [
{
id: "dana",
name: "Dana R.",
date: "2 days ago",
text: "I'd given up on centering after three wobbly attempts at home. The slow-wheel drill from week one finally made it click. My first cylinder actually stood up straight.",
helpful: 18,
reply: {
name: HOST,
date: "1 day ago",
text: "That drill is the whole secret, Dana. Bring the cylinder on Thursday and we'll trim a foot ring on it together.",
},
},
{
id: "tomas",
name: "Tomás V.",
date: "5 days ago",
text: "Is it normal for glaze to run on tall pieces? I lost a mug to the kiln shelf this week.",
helpful: 9,
reply: {
name: HOST,
date: "4 days ago",
text: "Very normal on a first glaze firing. Wipe the bottom quarter inch clean and dip twice, not three times. I've pinned our glaze-thickness chart in the group.",
},
},
{
id: "hollis",
name: "Hollis K.",
date: "1 week ago",
text: "Came for one Saturday class and stayed for the open-studio hours. Knowing the kiln is booked for us every Friday means I just get to make things.",
helpful: 14,
},
{
id: "ade",
name: "Ade O.",
date: "2 weeks ago",
text: "Can I bring my own clay, or do I need to use the studio's?",
reply: {
name: HOST,
date: "2 weeks ago",
text: "Studio clay is included and fires to our kiln's cone, so we ask everyone to use it. It keeps every shelf safe.",
},
},
{
id: "juniper",
name: "Juniper L.",
date: "3 weeks ago",
text: "My partner and I did the date-night wheel session. Two very lopsided bowls later, they're our favourite things in the house.",
helpful: 22,
},
{
id: "wren",
name: "Wren M.",
date: "1 month ago",
text: "How long until pieces come back from firing?",
reply: {
name: HOST,
date: "1 month ago",
text: "Bisque goes in every Friday and glaze the following Wednesday. Most pieces land on the pickup shelf within twelve days.",
},
},
{
id: "sam",
name: "Sam B.",
date: "1 month ago",
text: "Trimming used to terrify me. Two sessions in and I'm carving feet I'm proud of.",
helpful: 6,
},
];
export default function CommentStackSpecimen({ state = "default" }: { state?: SpecimenState }) {
return (
<CommentStack
headline="Hear it from potters already at the wheel"
highlight="already at the wheel"
lead="Questions, small wins and wobbly first bowls from the Kiln & Co. members' group, answered by our studio host."
comments={threads}
groupName="Kiln & Co. Members' Studio"
memberCount="1,240"
actionLabel="Start my first bowl"
actionNote="Beginner wheel night · clay and firing included"
state={state}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalCommentStack |
React.ReactNode |
|
highlight OptionalCommentStack |
string |
|
lead OptionalCommentStack |
string |
|
comments OptionalCommentStack |
CommentStackThread[] |
|
groupName OptionalCommentStack |
string |
|
memberCount OptionalCommentStack |
string |
|
initialCount OptionalCommentStack |
number |
|
actionLabel OptionalCommentStack |
string |
|
actionNote OptionalCommentStack |
string |
|
href OptionalCommentStack |
string |
|
onAction OptionalCommentStack |
() => void |
|
backdropImage OptionalCommentStack |
string |
|
defaultExpanded OptionalCommentStack |
boolean |
|
state OptionalCommentStack |
"default" | "hover" | "active" | "disabled" |
|
className OptionalCommentStack |
string |
|
copy OptionalCommentStack |
Partial<CommentStackCopy> |
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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
5602e47ebdb81810.webp
image/webp · 35.6 KB
-
c8cba8e5f188490f.webp
image/webp · 35.9 KB