Style Picker 1
Style picker block: the visitor taps a coach style and immediately reads a real sample message in that voice. Personalisation is shown rather than claimed, and the one action sits right below it.
Use it in a prompt
Use content/style-picker 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/content/style-picker.tsx. - Import it and pass your copy and images (Props tab):
import { StylePicker } from "@/components/funneldna/content/style-picker"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/style-picker/component.tsx 616 lines
// layout: spotlight-row
// Style picker block: the visitor taps a coach style and immediately reads a real sample message in that voice. Personalisation is shown rather than claimed, and the one action sits right below it.
import React from "react";
import { Activity, CalendarDays, Check, Leaf, MessageCircle, Smile, Timer, Volume2 } from "lucide-react";
import type { LucideIcon } from "lucide-react";
import { Divider, FX_HOST, Pattern, Spot } from "../fx/fx";
import star from "../fx/spots/star";
import clock from "../fx/spots/clock";
import chart from "../fx/spots/chart";
import book from "../fx/spots/book";
import calendar from "../fx/spots/calendar";
export type StylePickerStyle = {
id: string;
/** Chip label and card title */
name: string;
/** One short line under the name on the card */
summary?: string;
/** Small tone label shown above the sample message */
tone: string;
/** The sample message, one sentence per line; a one-word line is set as the punch line */
message: string[];
/** fx Spot clay illustration (an imported spot asset URL), tinted by the theme */
art?: string;
/** A full-colour transparent cut-out shown instead of a Spot */
image?: string;
imageAlt?: string;
/** Inline icon on the picker chip and the message avatar */
icon?: LucideIcon;
disabled?: boolean;
};
export type StylePickerProps = {
headline?: string;
/** Phrase inside the headline set in the accent colour */
highlight?: string;
lead?: string;
styles?: StylePickerStyle[];
defaultStyleId?: string;
/** Name shown on the sample message, e.g. the app or coach name */
senderName?: string;
/** One small line under the message, e.g. what triggered it */
messageNote?: string;
/** Accessible name of the chip radio group */
pickerLabel?: string;
/** Button label; {style} becomes the chosen style's name */
ctaLabel?: string;
/** One line under the button; {style} becomes the chosen style's name */
ctaNote?: string;
href?: string;
/** Called with the chosen style id when the button is clicked */
onAction?: (styleId: string) => void;
/** Called with the style id whenever the visitor picks a style */
onChange?: (styleId: string) => void;
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
const DEFAULT_STYLES: StylePickerStyle[] = [
{
id: "encouraging",
name: "Encouraging",
summary: "Cheers every small win",
tone: "Warm and supportive",
message: ["You showed up again today.", "That makes three days in a row.", "Small steps add up.", "Proud."],
art: star,
icon: Smile,
},
{
id: "tough-love",
name: "Tough love",
summary: "No excuses, no fluff",
tone: "Blunt and demanding",
message: ["You skipped yesterday.", "Today we make it up.", "Twenty minutes, starting now.", "Go."],
art: clock,
icon: Timer,
},
{
id: "data",
name: "Data-driven",
summary: "Every number, explained",
tone: "Precise and curious",
message: ["Four sessions this week, up from three.", "Your best work happens before 9am.", "Book tomorrow's session early.", "Noted."],
art: chart,
icon: Activity,
},
{
id: "calm",
name: "Calm",
summary: "Steady and unhurried",
tone: "Gentle and mindful",
message: ["A slower day is still a day.", "Rest is part of the plan.", "Tomorrow: ten easy minutes.", "Breathe."],
art: book,
icon: Leaf,
},
{
id: "planner",
name: "Planner",
summary: "Maps out your week",
tone: "Organised and clear",
message: ["Tuesday: 20 minutes.", "Thursday: 30 minutes.", "Saturday is your longer session.", "Sorted."],
art: calendar,
icon: CalendarDays,
},
];
export function StylePicker({
headline = "Pick your coach's style.",
highlight = "coach's style",
lead = "Same plan. Different voice. Choose the one that gets you moving.",
styles = DEFAULT_STYLES,
defaultStyleId,
senderName = "Your coach",
messageNote = "Sample check-in in this style",
pickerLabel = "Coach styles",
ctaLabel = "Yes! Coach me this way",
ctaNote = "Your pick: {style}",
href,
onAction,
onChange,
state = "default",
className,
}: StylePickerProps) {
const uid = React.useId();
const initial =
styles.find((s) => s.id === defaultStyleId && !s.disabled) ?? styles.find((s) => !s.disabled) ?? styles[0];
const [activeId, setActiveId] = React.useState<string | undefined>(initial?.id);
const [swapped, setSwapped] = React.useState(false);
const chipRefs = React.useRef<(HTMLButtonElement | null)[]>([]);
const active = styles.find((s) => s.id === activeId) ?? initial;
if (!active) return null;
const allDisabled = state === "disabled";
const ActiveIcon = active.icon ?? Smile;
const hoverIndex =
state === "hover" ? styles.findIndex((s) => s.id !== active.id && !s.disabled) : -1;
const choose = (s: StylePickerStyle) => {
if (s.disabled || allDisabled || s.id === active.id) return;
setActiveId(s.id);
setSwapped(true);
onChange?.(s.id);
};
const onKey = (e: React.KeyboardEvent<HTMLButtonElement>, index: number) => {
const keys = ["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp", "Home", "End"];
if (!keys.includes(e.key)) return;
e.preventDefault();
const n = styles.length;
let i = e.key === "Home" ? -1 : e.key === "End" ? n : index;
const dir = e.key === "Home" ? 1 : e.key === "End" ? -1 : e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 1;
for (let k = 0; k < n; k += 1) {
i = (i + dir + n) % n;
if (!styles[i].disabled) {
choose(styles[i]);
chipRefs.current[i]?.focus();
break;
}
}
};
const swap = swapped ? " is-swap" : "";
const ctaClass = `cf-style-picker__cta${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-press" : ""}`;
const ctaText = fill(ctaLabel, active.name);
return (
<section
className={["cf-style-picker", className].filter(Boolean).join(" ")}
style={FX_HOST}
data-state={state}
aria-labelledby={`${uid}-title`}
>
<style>{CSS}</style>
<div className="cf-style-picker__edge" aria-hidden="true">
<Divider shape="angle" tone="surface" height={56} />
</div>
<div className="cf-style-picker__inner">
<header className="cf-style-picker__head">
<h2 id={`${uid}-title`} className="cf-style-picker__title">
{renderHeadline(headline, highlight)}
</h2>
{lead ? <p className="cf-style-picker__lead">{lead}</p> : null}
</header>
<div className="cf-style-picker__panel">
<div className="cf-style-picker__card">
<div className="cf-style-picker__well" style={FX_HOST}>
<div className="cf-style-picker__pattern" aria-hidden="true">
<Pattern name="rings" fade="corner" />
</div>
<div key={active.id} className={`cf-style-picker__art${swapped ? " is-pop" : ""}`}>
<StyleArt style={active} />
</div>
</div>
<div key={`${active.id}-name`} className={`cf-style-picker__id${swap}`}>
<h3 className="cf-style-picker__name">{active.name}</h3>
{active.summary ? <p className="cf-style-picker__summary">{active.summary}</p> : null}
</div>
</div>
<div className="cf-style-picker__msg">
<span key={`${active.id}-tone`} className={`cf-style-picker__tone${swap}`}>
<Volume2 size={16} strokeWidth={2.5} aria-hidden="true" />
{active.tone}
</span>
<div className="cf-style-picker__bubble" aria-live="polite">
<div key={`${active.id}-bubble`} className={swapped ? "is-swap" : undefined}>
<div className="cf-style-picker__from">
<span className="cf-style-picker__avatar" aria-hidden="true">
<ActiveIcon size={20} strokeWidth={2.5} />
</span>
<span className="cf-style-picker__sender">
<strong>{senderName}</strong>
<span aria-hidden="true">·</span>
<span>{active.name}</span>
</span>
</div>
{active.message.map((line, i) => (
<p
key={`${active.id}-${i}`}
className={
isPunch(line, i, active.message.length) ? "cf-style-picker__line is-punch" : "cf-style-picker__line"
}
>
{line}
</p>
))}
</div>
</div>
{messageNote ? (
<p className="cf-style-picker__note">
<MessageCircle size={16} strokeWidth={2.5} aria-hidden="true" />
{messageNote}
</p>
) : null}
</div>
<div className="cf-style-picker__chips" role="radiogroup" aria-label={pickerLabel}>
{styles.map((s, i) => {
const Icon = s.icon ?? Smile;
const checked = s.id === active.id;
return (
<button
key={s.id}
ref={(el) => {
chipRefs.current[i] = el;
}}
type="button"
role="radio"
aria-checked={checked}
tabIndex={checked ? 0 : -1}
disabled={s.disabled || allDisabled}
className={`cf-style-picker__chip${i === hoverIndex ? " is-hover" : ""}`}
onClick={() => choose(s)}
onKeyDown={(e) => onKey(e, i)}
>
<span className="cf-style-picker__dot">
<Icon size={24} strokeWidth={2.5} aria-hidden="true" />
</span>
<span className="cf-style-picker__label">{s.name}</span>
</button>
);
})}
</div>
<div className="cf-style-picker__action">
{href && !allDisabled ? (
<a className={ctaClass} href={href} onClick={() => onAction?.(active.id)}>
{ctaText}
</a>
) : (
<button type="button" className={ctaClass} disabled={allDisabled} onClick={() => onAction?.(active.id)}>
{ctaText}
</button>
)}
{ctaNote ? (
<p className="cf-style-picker__reassure">
<Check size={16} strokeWidth={2.5} aria-hidden="true" />
{fill(ctaNote, active.name)}
</p>
) : null}
</div>
</div>
</div>
</section>
);
}
export default StylePicker;
function StyleArt({ style }: { style: StylePickerStyle }) {
if (style.image) {
return <img className="cf-style-picker__img" src={style.image} alt={style.imageAlt ?? ""} />;
}
if (style.art) return <Spot src={style.art} size={168} />;
const Icon = style.icon ?? Smile;
return <Icon className="cf-style-picker__fallback" size={72} strokeWidth={2.5} aria-hidden="true" />;
}
function fill(template: string, styleName: string) {
return template.split("{style}").join(styleName);
}
/** The closing line is set as the punch line when it is short (one or two words), e.g. "Proud." or "Lace up." */
function isPunch(line: string, index: number, count: number) {
const text = line.trim();
const words = text.split(/\s+/).filter(Boolean).length;
return index === count - 1 && words > 0 && words <= 2 && text.length <= 16;
}
function renderHeadline(text: string, phrase?: string) {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="cf-style-picker__em">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
const CSS = `
.cf-style-picker {
--sp-band: color-mix(in oklch, var(--ink) 4%, var(--surface));
--sp-line: oklch(from var(--ink) l c h / 0.12);
--sp-focus: oklch(from var(--field-focus, var(--accent)) l c h / 0.45);
--sp-shadow: var(--shadow, oklch(0.22 0.03 260));
--sp-gutter: clamp(16px, 5vw, 48px);
position: relative;
overflow: hidden;
background: var(--sp-band);
color: var(--ink);
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) var(--sp-gutter) calc(clamp(64px, 8.5vw, 120px) + 56px);
}
.cf-style-picker *, .cf-style-picker *::before, .cf-style-picker *::after { box-sizing: border-box; }
.cf-style-picker__edge { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none; z-index: 0; }
.cf-style-picker__inner { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; }
.cf-style-picker__head { max-width: 46rem; margin: 0 auto clamp(32px, 4.5vw, 56px); text-align: center; }
.cf-style-picker__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(--ink);
}
.cf-style-picker__em { color: var(--accent); }
.cf-style-picker__lead {
margin: 16px auto 0;
max-width: 40rem;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.4;
font-weight: 500;
color: var(--muted);
text-wrap: balance;
}
.cf-style-picker__panel {
display: grid;
grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
grid-template-areas: "card msg" "chips chips" "action action";
column-gap: clamp(32px, 5vw, 64px);
row-gap: 40px;
align-items: start;
}
.cf-style-picker__card {
grid-area: card;
padding: 12px;
background: var(--card);
border: 1px solid var(--card-border, oklch(from var(--accent) l c h / 0.32));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--sp-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--sp-shadow) l c h / 0.32)));
}
.cf-style-picker__well {
position: relative;
overflow: hidden;
isolation: isolate;
display: grid;
place-items: center;
aspect-ratio: 1 / 0.86;
border-radius: max(0px, calc(var(--card-radius, var(--radius, 14px)) - 4px));
background: color-mix(in oklch, var(--ink) 4%, var(--card));
}
.cf-style-picker__pattern { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.cf-style-picker__art { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; }
.cf-style-picker__img {
width: 72%;
height: auto;
max-height: 82%;
object-fit: contain;
filter: drop-shadow(0 2px 3px oklch(from var(--sp-shadow) l c h / 0.25)) drop-shadow(0 12px 16px oklch(from var(--sp-shadow) l c h / 0.18));
}
.cf-style-picker__fallback { width: 72px; height: 72px; color: var(--accent); }
.cf-style-picker__id { padding: 20px 12px 10px; }
.cf-style-picker__name {
margin: 0;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
color: var(--ink);
text-wrap: balance;
}
.cf-style-picker__summary { margin: 8px 0 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.cf-style-picker__msg { grid-area: msg; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 8px; min-width: 0; }
.cf-style-picker__tone {
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 32px;
padding: 4px 12px;
border-radius: 999px;
background: color-mix(in oklch, var(--ink) 6%, var(--card));
border: 1px solid var(--sp-line);
font-size: 0.875rem;
font-weight: 800;
line-height: 1.2;
color: var(--ink);
}
.cf-style-picker__tone svg { color: var(--accent); flex: 0 0 auto; }
.cf-style-picker__bubble {
width: 100%;
max-width: 34rem;
padding: clamp(20px, 3vw, 28px);
background: var(--card);
border: 1px solid var(--card-border, var(--sp-line));
border-radius: var(--card-radius, var(--radius, 14px));
border-end-start-radius: 4px;
box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--sp-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--sp-shadow) l c h / 0.2)));
}
.cf-style-picker__from { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cf-style-picker__avatar {
display: grid;
place-items: center;
flex: 0 0 40px;
width: 40px;
height: 40px;
border-radius: 999px;
background: var(--accent-fill, var(--accent));
color: var(--accent-fill-ink, var(--card));
}
.cf-style-picker__sender { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 0.9375rem; line-height: 1.4; color: var(--muted); font-weight: 600; }
.cf-style-picker__sender strong { color: var(--ink); font-weight: 800; }
.cf-style-picker__line {
margin: 0 0 8px;
font-size: clamp(1.125rem, 1.5vw, 1.3125rem);
line-height: 1.42;
font-weight: 500;
color: var(--ink);
text-wrap: pretty;
}
.cf-style-picker__line:last-child { margin-bottom: 0; }
.cf-style-picker__line.is-punch {
margin-top: 4px;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
color: var(--accent);
}
.cf-style-picker__note { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.cf-style-picker__note svg { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-style-picker__chips { grid-area: chips; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 12px; row-gap: 20px; padding: 12px 0 4px; }
.cf-style-picker__chip {
appearance: none;
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
flex: 0 0 96px;
width: 96px;
margin: 0;
padding: 0 2px 4px;
background: none;
border: 0;
font: inherit;
color: var(--muted);
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.cf-style-picker__chip:focus-visible { outline: none; }
.cf-style-picker__dot {
display: grid;
place-items: center;
width: 60px;
height: 60px;
border-radius: 999px;
background: var(--card);
border: 1px solid var(--sp-line);
color: var(--muted);
box-shadow: var(--shadow-sm, 0 1px 1px oklch(from var(--sp-shadow) l c h / 0.18), 0 1px 3px oklch(from var(--sp-shadow) l c h / 0.14));
transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.cf-style-picker__label { font-size: 0.875rem; line-height: 1.2; font-weight: 700; text-align: center; text-wrap: balance; color: var(--muted); }
.cf-style-picker__chip:hover:not(:disabled) .cf-style-picker__dot,
.cf-style-picker__chip.is-hover .cf-style-picker__dot {
transform: translateY(-2px);
color: var(--ink);
box-shadow: var(--shadow-md, 0 1px 2px oklch(from var(--sp-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--sp-shadow) l c h / 0.2));
}
.cf-style-picker__chip:hover:not(:disabled) .cf-style-picker__label,
.cf-style-picker__chip.is-hover .cf-style-picker__label { color: var(--ink); }
.cf-style-picker__chip:active:not(:disabled) .cf-style-picker__dot { transform: scale(0.95); }
.cf-style-picker__chip[aria-checked="true"] .cf-style-picker__dot {
background: color-mix(in oklch, var(--accent) 12%, var(--card));
border-color: transparent;
color: var(--accent);
box-shadow: 0 0 0 3px var(--sp-band), 0 0 0 5px var(--accent), var(--shadow-sm, 0 1px 3px oklch(from var(--sp-shadow) l c h / 0.14));
}
.cf-style-picker__chip[aria-checked="true"] .cf-style-picker__label { color: var(--ink); font-weight: 800; }
.cf-style-picker__chip:focus-visible .cf-style-picker__dot { outline: 3px solid var(--sp-focus); outline-offset: 7px; }
.cf-style-picker__chip:disabled { cursor: not-allowed; }
.cf-style-picker__chip:disabled .cf-style-picker__dot { background: var(--secondary); box-shadow: none; }
.cf-style-picker__chip:disabled .cf-style-picker__dot svg { opacity: 0.5; }
.cf-style-picker__action { grid-area: action; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; text-align: center; }
.cf-style-picker__cta {
--sp-btn: var(--button-bg, var(--cta));
--sp-btn-2: var(--button-bg-2, var(--cta-2));
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 64px;
min-width: min(100%, 340px);
max-width: 100%;
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;
text-align: center;
text-decoration: none;
color: var(--button-ink, var(--cta-ink));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--sp-btn) calc(l + 0.04) c h), oklch(from var(--sp-btn-2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--sp-btn) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--sp-btn) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--sp-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--sp-shadow) l c h / 0.45));
cursor: pointer;
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-style-picker__cta:hover:not(:disabled),
.cf-style-picker__cta.is-hover {
background: linear-gradient(oklch(from var(--sp-btn) calc(l - 0.01) c h), oklch(from var(--sp-btn-2) calc(l - 0.07) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--sp-btn) calc(l + 0.12) c h / 0.7), inset 0 -3px 0 oklch(from var(--sp-btn) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--sp-shadow) l c h / 0.32), 0 10px 18px -6px oklch(from var(--sp-shadow) l c h / 0.55));
}
.cf-style-picker__cta:active:not(:disabled),
.cf-style-picker__cta.is-press {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--sp-btn) calc(l - 0.03) c h), oklch(from var(--sp-btn-2) calc(l - 0.08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--sp-btn) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--sp-btn) calc(l - 0.16) c h), 0 1px 1px oklch(from var(--sp-shadow) l c h / 0.3);
}
.cf-style-picker__cta:focus-visible { outline: 3px solid var(--sp-focus); outline-offset: 3px; }
.cf-style-picker__cta:disabled {
cursor: not-allowed;
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));
}
.cf-style-picker__reassure { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted); text-wrap: pretty; }
.cf-style-picker__reassure svg { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; color: var(--success); }
@keyframes cf-style-picker-swap { from { opacity: 0.25; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cf-style-picker-pop { from { opacity: 0.25; transform: scale(0.9); } to { opacity: 1; transform: none; } }
.cf-style-picker .is-swap { animation: cf-style-picker-swap 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.cf-style-picker .is-pop { animation: cf-style-picker-pop 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@media (max-width: 859px) {
.cf-style-picker__panel {
grid-template-columns: minmax(0, 1fr);
grid-template-areas: "card" "chips" "msg" "action";
row-gap: 24px;
max-width: 560px;
margin: 0 auto;
}
.cf-style-picker__card { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 16px; padding: 10px; }
.cf-style-picker__well { aspect-ratio: 1 / 1; }
.cf-style-picker__art { zoom: 0.56; }
.cf-style-picker__id { padding: 0 8px 0 0; }
.cf-style-picker__msg { padding-top: 0; }
.cf-style-picker__bubble { max-width: none; }
.cf-style-picker__chips { column-gap: 8px; row-gap: 20px; padding: 16px 0 8px; }
.cf-style-picker__chip { flex: 0 0 calc((100% - 16px) / 3); width: auto; min-width: 0; }
.cf-style-picker__dot { width: 56px; height: 56px; }
.cf-style-picker__cta { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
.cf-style-picker .is-swap, .cf-style-picker .is-pop { animation: none; }
.cf-style-picker__dot, .cf-style-picker__cta { transition: none; }
.cf-style-picker__chip:hover:not(:disabled) .cf-style-picker__dot,
.cf-style-picker__chip.is-hover .cf-style-picker__dot,
.cf-style-picker__chip:active:not(:disabled) .cf-style-picker__dot,
.cf-style-picker__cta.is-press,
.cf-style-picker__cta:active:not(:disabled) { transform: none; }
}
`;
pieces/content/style-picker/specimen.tsx 89 lines
import __studioImageaf78e74e from "../assets/bced217bc606fba4.webp";
import { Activity, Flag, Leaf, Mountain, Smile, Timer } from "lucide-react";
import { StylePicker } from "../style-picker";
import { slot } from "../../slots";
import type { StylePickerStyle } from "../style-picker";
import star from "../../fx/spots/star";
import clock from "../../fx/spots/clock";
import chart from "../../fx/spots/chart";
import rocket from "../../fx/spots/rocket";
import pin from "../../fx/spots/pin";
export const states = ["default", "hover", "active", "disabled"];
type DemoState = "default" | "hover" | "active" | "disabled";
export default function StylePickerDemo({ state = "default" }: { state?: DemoState }) {
const styles: StylePickerStyle[] = [
{
id: "encouraging",
name: "Encouraging",
summary: "Celebrates every run",
tone: "Warm and encouraging",
message: ["5K done before breakfast.", "Your last kilometre was your fastest.", "That's not luck. That's training.", "Proud."],
art: star,
icon: Smile,
},
{
id: "drill-sergeant",
name: "Drill sergeant",
summary: "No excuses. Ever.",
tone: "Blunt and demanding",
message: ["You walked at minute 22.", "We don't walk at minute 22.", "Tomorrow: 6 × 400 m. Full effort.", "Lace up."],
art: clock,
icon: Timer,
},
{
id: "data-nerd",
name: "Data nerd",
summary: "Every split, explained",
tone: "Precise and curious",
message: ["Avg pace 5:41/km, 9 s faster than last week.", "Cadence held at 172 the whole way.", "Heart rate drifted after 4 km. Drink earlier.", "Noted."],
art: chart,
icon: Activity,
},
{
id: "zen",
name: "Zen",
summary: "Run by feel, not by watch",
tone: "Calm and mindful",
message: ["You ran 5K and you noticed the sunrise.", "Both count.", "Tomorrow is an easy 30 minutes. Breathe through your nose.", "Enough."],
art: slot("item-4", __studioImageaf78e74e),
icon: Leaf,
},
{
id: "race-planner",
name: "Race planner",
summary: "Plans your race-day pace",
tone: "Tactical and focused",
message: ["Race day is 19 days out.", "Today's tempo says you can hold 5:20/km for 10K.", "Start at 5:30. Speed up from km 6.", "Planned."],
art: rocket,
icon: Flag,
},
{
id: "trail-buddy",
name: "Trail buddy",
summary: "Makes miles feel like play",
tone: "Easygoing and playful",
message: ["Mud on the shoes means it was a good one.", "That hill at km 3? You owned it.", "Saturday: the river loop, 8 km, no watch.", "Deal?"],
art: pin,
icon: Mountain,
},
];
return (
<StylePicker
headline="Pick your coach's style."
highlight="coach's style"
lead="Same training plan. Six different voices. Pick the one that gets you out the door."
styles={styles}
defaultStyleId="encouraging"
senderName="Stride Coach"
messageNote="Sample check-in after a morning 5K"
pickerLabel="Stride Coach styles"
ctaLabel="Yes! I want Stride Coach"
ctaNote="Starts in {style} mode. Switch anytime."
state={state}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalStylePicker |
string |
Default "Pick your coach's style."
|
highlight OptionalStylePicker |
string |
Default "coach's style"
|
lead OptionalStylePicker |
string |
Default "Same plan. Different voice. Choose the one that gets you moving."
|
styles OptionalStylePicker |
StylePickerStyle[] |
Default DEFAULT_STYLES
|
defaultStyleId OptionalStylePicker |
string |
|
senderName OptionalStylePicker |
string |
Default "Your coach"
|
messageNote OptionalStylePicker |
string |
Default "Sample check-in in this style"
|
pickerLabel OptionalStylePicker |
string |
Default "Coach styles"
|
ctaLabel OptionalStylePicker |
string |
Default "Yes! Coach me this way"
|
ctaNote OptionalStylePicker |
string |
Default "Your pick: {style}"
|
href OptionalStylePicker |
string |
|
onAction OptionalStylePicker |
(styleId: string) => void |
|
onChange OptionalStylePicker |
(styleId: string) => void |
|
state OptionalStylePicker |
"default" | "hover" | "active" | "disabled" |
Default "default"
|
className OptionalStylePicker |
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-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-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-4- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
0d114386aa55e8d2.webp
image/webp · 15.6 KB
-
321240b3188e2da4.webp
image/webp · 18.7 KB
-
369bb6f216bb84ab.webp
image/webp · 22.6 KB
-
7c36d7f4dd4ae594.webp
image/webp · 26.5 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
bced217bc606fba4.webp
image/webp · 91.1 KB
-
d7814fce240ddf0e.webp
image/webp · 17.6 KB
-
f6a8de367400456e.webp
image/webp · 14.6 KB