Saas Trial Hero 2
Software trial hero: the visitor drags a handle from the old way (a messy spreadsheet) to the product doing the same job, then starts the trial from the after side.
Use it in a prompt
Use hero/saas-trial-hero-2 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/hero/saas-trial-hero-2.tsx. - Import it and pass your copy and images (Props tab):
import { SaasTrialHero2 } from "@/components/funneldna/hero/saas-trial-hero-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/saas-trial-hero-2/component.tsx 574 lines
// layout: before-after-split
// Software trial hero: the visitor drags a handle from the old way (a messy spreadsheet) to the product doing the same job, then starts the trial from the after side.
import * as React from "react";
import { AlertCircle, Check, ChevronsLeftRight, X } from "lucide-react";
import { FX_HOST, Glow } from "../fx/fx";
export type SaasTrialHero2Point = {
/** Bold lead-in phrase that opens the line. */
lead: string;
/** The rest of the line after the lead-in. */
body: string;
};
export type SaasTrialHero2Props = {
/** Outcome headline (the page's h1). */
headline?: string;
/** Phrase inside the headline set at full strength; the rest of the headline is set softer. */
highlight?: string;
/** Lead under the headline. */
lead?: string;
/** Image of the current, messy way of doing the job (slot "before"). The comparison is hidden without both images. */
beforeImage?: string;
/** Alt text for the before image. */
beforeAlt?: string;
/** Product screenshot doing the same job (slot "screenshot"). */
afterImage?: string;
/** Alt text for the product screenshot. */
afterAlt?: string;
/** Label beside the stage for the before side; clicking it shows the whole before view. */
beforeLabel?: string;
/** Caption under the before label. Hidden when empty. */
beforeCaption?: string;
/** Label beside the stage for the after side; clicking it shows the whole after view. */
afterLabel?: string;
/** Caption under the after label. Hidden when empty. */
afterCaption?: string;
/** Where the handle starts: 0 shows all of the after view, 100 all of the before view. */
startPosition?: number;
/** Line under the comparison. Hidden when empty. */
hint?: string;
/** Heading of the trial card on the after side. */
actionTitle?: string;
/** Short paragraphs, each opening with a bold lead-in. */
points?: SaasTrialHero2Point[];
/** Price figure, e.g. "$47". The price block is hidden when empty. */
price?: string;
/** Words beside the price, e.g. "a month after your trial". */
priceTerm?: string;
/** Breakdown under the price, e.g. "About $1.57 a day". Hidden when empty. */
priceBreakdown?: string;
/** Visible label above the email field. */
emailLabel?: string;
/** Example answer shown in the empty email field. */
emailPlaceholder?: string;
/** Ticked commitment line above the button (must stay ticked to continue). Hidden when empty. */
commitLabel?: string;
/** Trial button label. */
buttonLabel?: string;
/** One short line under the button. Hidden when empty. */
note?: string;
/** Generated copy: field and commit messages, the slider's accessible name and value text ({before} and {after} are percentages). */
copy?: {
required?: string;
invalid?: string;
commit?: string;
slider?: string;
sliderValue?: string;
};
/** Called with the validated email. */
onSubmit?: (values: { email: string }) => void;
/** Called after a valid submit. */
onAction?: () => void;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
export function SaasTrialHero2(props: SaasTrialHero2Props) {
const {
headline = "See this week's job get easier before you sign up",
highlight = "get easier",
lead = "Drag the handle to compare the way you do it now with the same job done in the app.",
beforeImage = "",
beforeAlt = "The job done the current way",
afterImage = "",
afterAlt = "The same job done in the product",
beforeLabel = "Before",
beforeCaption = "The way you do it now",
afterLabel = "After",
afterCaption = "The same job in the app",
startPosition = 50,
hint = "Drag the handle, or use your arrow keys, to compare.",
actionTitle = "Start your trial today",
points = DEFAULT_POINTS,
price = "",
priceTerm = "",
priceBreakdown = "",
emailLabel = "Your work email",
emailPlaceholder = "you@example.com",
commitLabel = "",
buttonLabel = "Start My Trial",
note = "",
copy,
onSubmit,
onAction,
state = "default",
className,
} = props;
const msgRequired = copy?.required ?? "Enter your email to start your trial.";
const msgInvalid = copy?.invalid ?? "That email looks off. Check it and try again.";
const msgCommit = copy?.commit ?? "Tick the box above to continue.";
const msgSlider = copy?.slider ?? "Compare before and after";
const msgSliderValue = copy?.sliderValue ?? "{before}% before, {after}% after";
const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, "");
const titleId = `sth2-${uid}-title`;
const stageId = `sth2-${uid}-stage`;
const hintId = `sth2-${uid}-hint`;
const emailId = `sth2-${uid}-email`;
const errorId = `sth2-${uid}-error`;
const commitErrorId = `sth2-${uid}-commit`;
const hasStage = Boolean(beforeImage && afterImage);
const hasCommit = Boolean(commitLabel);
const forced = state === "hover" ? " is-hover" : state === "active" ? " is-active" : "";
const [pos, setPos] = React.useState(() => clamp(startPosition));
const [dragging, setDragging] = React.useState(false);
const stageRef = React.useRef<HTMLDivElement>(null);
const knobRef = React.useRef<HTMLDivElement>(null);
const press = React.useRef<{ id: number; x: number; moved: boolean; mouse: boolean } | null>(null);
React.useEffect(() => {
setPos(clamp(startPosition));
}, [startPosition]);
const [email, setEmail] = React.useState("");
const [error, setError] = React.useState(() => (state === "error" ? msgRequired : ""));
const [committed, setCommitted] = React.useState(true);
const [commitError, setCommitError] = React.useState(false);
const inputRef = React.useRef<HTMLInputElement>(null);
React.useEffect(() => {
setError(state === "error" ? msgRequired : "");
}, [state, msgRequired]);
const validate = (value: string) => {
const v = value.trim();
if (!v) return msgRequired;
return EMAIL.test(v) ? "" : msgInvalid;
};
const blocked = state === "disabled" || Boolean(error) || (hasCommit && !committed);
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (state === "disabled") return;
const problem = validate(email);
if (problem) {
setError(problem);
inputRef.current?.focus();
return;
}
if (hasCommit && !committed) {
setCommitError(true);
return;
}
onSubmit?.({ email: email.trim() });
onAction?.();
};
const fromClientX = (clientX: number) => {
const el = stageRef.current;
if (!el) return pos;
const rect = el.getBoundingClientRect();
if (!rect.width) return pos;
return clamp(((clientX - rect.left) / rect.width) * 100);
};
const onPointerDown = (event: React.PointerEvent<HTMLDivElement>) => {
const mouse = event.pointerType === "mouse";
if (mouse) {
if (event.button !== 0) return;
event.preventDefault();
}
press.current = { id: event.pointerId, x: event.clientX, moved: false, mouse };
try {
event.currentTarget.setPointerCapture(event.pointerId);
} catch {
// capture is a nicety; dragging still works inside the stage
}
};
const onPointerMove = (event: React.PointerEvent<HTMLDivElement>) => {
const p = press.current;
if (!p || p.id !== event.pointerId) return;
if (!p.moved && Math.abs(event.clientX - p.x) < 4) return;
if (!p.moved) {
p.moved = true;
setDragging(true);
}
setPos(fromClientX(event.clientX));
};
const onPointerUp = (event: React.PointerEvent<HTMLDivElement>) => {
const p = press.current;
if (!p || p.id !== event.pointerId) return;
if (!p.moved) setPos(fromClientX(event.clientX));
press.current = null;
setDragging(false);
if (p.mouse) knobRef.current?.focus({ preventScroll: true });
};
const onPointerCancel = () => {
press.current = null;
setDragging(false);
};
const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
const step = event.shiftKey ? 10 : 5;
let next: number | null = null;
switch (event.key) {
case "ArrowLeft":
case "ArrowDown":
next = pos - step;
break;
case "ArrowRight":
case "ArrowUp":
next = pos + step;
break;
case "PageDown":
next = pos - 20;
break;
case "PageUp":
next = pos + 20;
break;
case "Home":
next = 0;
break;
case "End":
next = 100;
break;
}
if (next !== null) {
event.preventDefault();
setPos(clamp(next));
}
};
const shown = Math.round(pos);
const valueText = msgSliderValue.replace("{before}", String(shown)).replace("{after}", String(100 - shown));
const stageStyle = { "--pos": `${pos}%` } as React.CSSProperties;
const hl = splitHighlight(headline, highlight);
return (
<section
className={["cf-saas-trial-hero-2", className].filter(Boolean).join(" ")}
style={FX_HOST}
aria-labelledby={titleId}
>
<style>{CSS}</style>
<Glow />
<div className={`sth2-wrap${hasStage ? "" : " is-solo"}`}>
<header className="sth2-head">
<h1 id={titleId} className={`sth2-title${hl.found ? " has-hl" : ""}`}>
{hl.node}
</h1>
{lead ? <p className="sth2-lead">{lead}</p> : null}
</header>
{hasStage ? (
<div className="sth2-compare">
<div className="sth2-sides">
<div className="sth2-side">
<button
type="button"
className="sth2-chip"
data-on={pos >= 50 ? "true" : "false"}
aria-controls={stageId}
onClick={() => setPos(100)}
>
<span className="sth2-badge is-bad" aria-hidden="true">
<X size={16} strokeWidth={3} />
</span>
{beforeLabel}
</button>
{beforeCaption ? <p className="sth2-caption">{beforeCaption}</p> : null}
</div>
<div className="sth2-side is-after">
<button
type="button"
className="sth2-chip"
data-on={pos <= 50 ? "true" : "false"}
aria-controls={stageId}
onClick={() => setPos(0)}
>
<span className="sth2-badge is-good" aria-hidden="true">
<Check size={16} strokeWidth={3} />
</span>
{afterLabel}
</button>
{afterCaption ? <p className="sth2-caption">{afterCaption}</p> : null}
</div>
</div>
<div
ref={stageRef}
id={stageId}
className={`sth2-stage${dragging ? " is-drag" : ""}`}
style={stageStyle}
onPointerDown={onPointerDown}
onPointerMove={onPointerMove}
onPointerUp={onPointerUp}
onPointerCancel={onPointerCancel}
>
<img className="sth2-before" src={beforeImage} alt={beforeAlt} draggable={false} />
<div className="sth2-after-layer">
<img className="sth2-after" src={afterImage} alt={afterAlt} draggable={false} />
</div>
<span className="sth2-line" aria-hidden="true" />
<div
ref={knobRef}
className="sth2-knob"
role="slider"
tabIndex={0}
aria-label={msgSlider}
aria-orientation="horizontal"
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={shown}
aria-valuetext={valueText}
aria-describedby={hint ? hintId : undefined}
onKeyDown={onKeyDown}
>
<ChevronsLeftRight size={24} strokeWidth={2.5} aria-hidden="true" />
</div>
</div>
{hint ? (
<p id={hintId} className="sth2-hint">
<ChevronsLeftRight size={16} strokeWidth={2.5} aria-hidden="true" />
{hint}
</p>
) : null}
</div>
) : null}
<div className="sth2-card">
<h2 className="sth2-card-title">{actionTitle}</h2>
{points.length ? (
<ul className="sth2-points">
{points.map((point) => (
<li key={point.lead} className="sth2-point">
<strong>{point.lead}</strong> {point.body}
</li>
))}
</ul>
) : null}
{price ? (
<div className="sth2-price">
<span className="sth2-amount">{price}</span>
{priceTerm || priceBreakdown ? (
<span className="sth2-price-copy">
{priceTerm ? <span className="sth2-term">{priceTerm}</span> : null}
{priceBreakdown ? <span className="sth2-perday">{priceBreakdown}</span> : null}
</span>
) : null}
</div>
) : null}
<form className="sth2-form" noValidate onSubmit={handleSubmit}>
<label className="sth2-label" htmlFor={emailId}>
{emailLabel}
</label>
<input
ref={inputRef}
id={emailId}
className="sth2-input"
name="email"
type="email"
inputMode="email"
autoComplete="email"
enterKeyHint="go"
placeholder={emailPlaceholder}
value={email}
onChange={(event) => {
const v = event.target.value;
setEmail(v);
if (error) setError(validate(v));
}}
onBlur={() => {
if (email.trim()) setError(validate(email));
}}
aria-invalid={error ? true : undefined}
aria-describedby={error ? errorId : undefined}
/>
<div aria-live="polite">
{error ? (
<p id={errorId} className="sth2-error">
<AlertCircle size={16} strokeWidth={2.5} aria-hidden="true" />
{error}
</p>
) : null}
</div>
{hasCommit ? (
<label className="sth2-commit">
<input
type="checkbox"
name="commit"
checked={committed}
onChange={(event) => {
setCommitted(event.target.checked);
if (event.target.checked) setCommitError(false);
}}
aria-describedby={commitError && !committed ? commitErrorId : undefined}
/>
<span className="sth2-box" aria-hidden="true">
{committed ? <Check size={16} strokeWidth={3} /> : null}
</span>
<span className="sth2-commit-text">{commitLabel}</span>
</label>
) : null}
<div aria-live="polite">
{hasCommit && commitError && !committed ? (
<p id={commitErrorId} className="sth2-error">
<AlertCircle size={16} strokeWidth={2.5} aria-hidden="true" />
{msgCommit}
</p>
) : null}
</div>
<button type="submit" className={`sth2-btn${forced}`} aria-disabled={blocked ? true : undefined}>
{buttonLabel}
</button>
{note ? <p className="sth2-note">{note}</p> : null}
</form>
</div>
</div>
</section>
);
}
export default SaasTrialHero2;
const DEFAULT_POINTS: SaasTrialHero2Point[] = [
{ lead: "Set it up once.", body: "Reuse it every week instead of rebuilding it from scratch." },
{ lead: "Everyone sees the same thing.", body: "One shared view replaces the copies that drift out of date." },
];
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
function clamp(value: number) {
if (!Number.isFinite(value)) return 50;
return Math.min(100, Math.max(0, value));
}
function splitHighlight(text: string, phrase: string): { node: React.ReactNode; found: boolean } {
if (!phrase) return { node: text, found: false };
const i = text.indexOf(phrase);
if (i < 0) return { node: text, found: false };
return {
node: (
<>
{text.slice(0, i)}
<span className="sth2-hl">{phrase}</span>
{text.slice(i + phrase.length)}
</>
),
found: true,
};
}
const S = ".cf-saas-trial-hero-2";
const CSS = `
${S}{position:relative;isolation:isolate;overflow:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);-webkit-font-smoothing:antialiased}
${S} *,${S} *::before,${S} *::after{box-sizing:border-box}
${S} .sth2-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1.38fr) minmax(0,1fr);grid-template-areas:"head head" "stage card";column-gap:clamp(32px,4.5vw,64px);row-gap:clamp(32px,4vw,48px);align-items:start}
${S} .sth2-wrap.is-solo{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "card"}
${S} .sth2-wrap.is-solo .sth2-card{max-width:560px}
${S} .sth2-head{grid-area:head;min-width:0}
${S} .sth2-title{margin:0;font-family:var(--font-display);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--band-ink)}
${S} .sth2-title.has-hl{color:color-mix(in oklab,var(--band-ink) 72%,var(--band))}
${S} .sth2-hl{color:var(--band-ink)}
${S} .sth2-lead{margin:22px 0 0;max-width:62ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:color-mix(in oklab,var(--band-ink) 88%,var(--band));text-wrap:pretty}
${S} .sth2-compare{grid-area:stage;min-width:0}
${S} .sth2-sides{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin:0 0 16px}
${S} .sth2-side{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
${S} .sth2-side.is-after{align-items:flex-end;text-align:right}
${S} .sth2-chip{display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;min-height:36px;margin:0;padding:4px 14px 4px 6px;border-radius:999px;border:1px solid oklch(from var(--band-ink) l c h / .22);background:oklch(from var(--band-ink) l c h / .1);color:var(--band-ink);font-family:var(--font-body);font-size:.9375rem;font-weight:800;line-height:1.2;text-align:left;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
${S} .sth2-side.is-after .sth2-chip{text-align:right}
${S} .sth2-chip:hover{background:oklch(from var(--band-ink) l c h / .18)}
${S} .sth2-chip[data-on="true"]{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));border-color:var(--button-2-border,transparent);box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / .25)))}
${S} .sth2-chip[data-on="true"]:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h)}
${S} .sth2-chip:active{transform:translateY(1px)}
${S} .sth2-chip:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
${S} .sth2-badge{flex:none;display:inline-grid;place-items:center;width:24px;height:24px;border-radius:999px;color:var(--sth2-glyph,#fff)}
${S} .sth2-badge.is-bad{background:var(--danger)}
${S} .sth2-badge.is-good{background:var(--success)}
${S} .sth2-caption{margin:0;font-size:.9375rem;line-height:1.4;font-weight:500;color:color-mix(in oklab,var(--band-ink) 84%,var(--band));text-wrap:pretty}
${S} .sth2-stage{position:relative;aspect-ratio:4 / 3;border-radius:12px;overflow:hidden;background:color-mix(in oklch,var(--ink) 6%,var(--card));border:1px solid oklch(from var(--band-ink) l c h / .16);box-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));touch-action:pan-y;cursor:col-resize;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
${S} .sth2-stage img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;pointer-events:none;-webkit-user-drag:none}
${S} .sth2-before{object-position:center;filter:saturate(.88)}
${S} .sth2-after-layer{position:absolute;inset:0;clip-path:inset(0 0 0 var(--pos));transition:clip-path .3s cubic-bezier(.2,.7,.2,1)}
${S} .sth2-after{object-position:top center}
${S} .sth2-line{position:absolute;top:0;bottom:0;left:var(--pos);width:3px;margin-left:-1.5px;background:var(--card);box-shadow:-1px 0 0 oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .28),1px 0 0 oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .28);pointer-events:none;transition:left .3s cubic-bezier(.2,.7,.2,1)}
${S} .sth2-knob{position:absolute;top:50%;left:clamp(30px,var(--pos),calc(100% - 30px));width:56px;height:56px;margin:-28px 0 0 -28px;display:grid;place-items:center;border-radius:999px;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2));cursor:grab;outline:none;transition:left .3s cubic-bezier(.2,.7,.2,1),transform .16s ease,box-shadow .16s ease}
${S} .sth2-knob:hover{transform:scale(1.06)}
${S} .sth2-knob:focus-visible{box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2)),0 0 0 3px var(--card),0 0 0 6px var(--accent)}
${S} .sth2-stage.is-drag{cursor:grabbing}
${S} .sth2-stage.is-drag .sth2-after-layer,${S} .sth2-stage.is-drag .sth2-line,${S} .sth2-stage.is-drag .sth2-knob{transition:none}
${S} .sth2-stage.is-drag .sth2-knob{cursor:grabbing;transform:scale(.96)}
${S} .sth2-hint{margin:16px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:600;color:color-mix(in oklab,var(--band-ink) 84%,var(--band));text-wrap:pretty}
${S} .sth2-hint svg,${S} .sth2-error svg{display:inline-block;vertical-align:-.2em;margin-inline-end:.4em}
${S} .sth2-card{grid-area:card;min-width:0;display:flex;flex-direction:column;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)}
${S} .sth2-card-title{margin:0;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink)}
${S} .sth2-points{margin:16px 0 0;padding:0;list-style:none;display:grid;gap:12px}
${S} .sth2-point{margin:0;font-size:1.0625rem;line-height:1.5;color:var(--muted);text-wrap:pretty}
${S} .sth2-point strong{color:var(--ink);font-weight:800}
${S} .sth2-price{margin:24px 0 0;padding:16px 20px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));display:flex;align-items:center;gap:16px}
${S} .sth2-amount{flex:none;font-family:var(--font-display);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-weight:var(--display-weight,800);letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
${S} .sth2-price-copy{min-width:0;display:flex;flex-direction:column;gap:4px}
${S} .sth2-term{font-size:1.0625rem;line-height:1.3;font-weight:700;color:var(--ink);text-wrap:pretty}
${S} .sth2-perday{font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
${S} .sth2-form{margin:24px 0 0}
${S} .sth2-label{display:block;margin:0 0 8px;font-size:1rem;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink))}
${S} .sth2-input{display:block;width:100%;height:56px;margin:0;padding:0 16px;font-family:var(--font-body);font-size:1.0625rem;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));outline:none;appearance:none;-webkit-appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
${S} .sth2-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${S} .sth2-input:hover{border-color:color-mix(in oklch,var(--ink) 40%,transparent)}
${S} .sth2-input:focus{border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
${S} .sth2-input[aria-invalid="true"]{border-color:var(--danger)}
${S} .sth2-input[aria-invalid="true"]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
${S} .sth2-error{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
${S} .sth2-commit{position:relative;margin:16px 0 0;display:flex;align-items:flex-start;gap:12px;cursor:pointer;font-size:1rem;line-height:1.4;font-weight:600;color:var(--ink)}
${S} .sth2-commit input{position:absolute;top:0;left:0;width:24px;height:24px;margin:0;opacity:0;cursor:pointer}
${S} .sth2-box{flex:none;display:grid;place-items:center;width:24px;height:24px;margin-top:-1px;border-radius:7px;background:var(--field);color:var(--sth2-glyph,#fff);border:2px solid var(--field-border,color-mix(in oklch,var(--ink) 30%,transparent));transition:background .16s ease,border-color .16s ease,box-shadow .16s ease}
${S} .sth2-commit:hover .sth2-box{border-color:color-mix(in oklch,var(--ink) 45%,transparent)}
${S} .sth2-commit input:checked + .sth2-box{background:var(--success);border-color:var(--success)}
${S} .sth2-commit input:focus-visible + .sth2-box{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .45);outline-offset:2px}
${S} .sth2-commit-text{min-width:0;text-wrap:pretty}
${S} .sth2-btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:64px;margin:24px 0 0;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-wrap:balance;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45));cursor:pointer;transition:background .16s ease,box-shadow .16s ease,transform .16s ease}
${S} .sth2-btn:hover:not([aria-disabled="true"]),${S} .sth2-btn.is-hover{background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .1) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .34),0 10px 20px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .55))}
${S} .sth2-btn:active:not([aria-disabled="true"]),${S} .sth2-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .1) c h));box-shadow:inset 0 2px 3px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 1px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .28)}
${S} .sth2-btn:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
${S} .sth2-btn[aria-disabled="true"]{background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:none;cursor:not-allowed;transform:none}
${S} .sth2-note{margin:12px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
@keyframes sth2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
${S} .sth2-head,${S} .sth2-card,${S} .sth2-compare{animation:sth2-rise .45s cubic-bezier(.2,.7,.2,1) both}
${S} .sth2-card{animation-delay:.07s}
${S} .sth2-compare{animation-delay:.14s}
@media (max-width:880px){
${S} .sth2-wrap{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "card" "stage"}
${S} .sth2-card{max-width:640px}
${S} .sth2-points{order:5;margin-top:24px}
}
@media (max-width:480px){
${S} .sth2-sides{gap:12px}
${S} .sth2-btn{padding:12px 16px}
${S} .sth2-price{padding:16px}
${S} .sth2-knob{width:48px;height:48px;margin:-24px 0 0 -24px;left:clamp(26px,var(--pos),calc(100% - 26px))}
}
@media (prefers-reduced-motion:reduce){
${S} *,${S} *::before,${S} *::after{animation:none !important;transition:none !important}
}
`;
pieces/hero/saas-trial-hero-2/specimen.tsx 49 lines
import __studioImage0e61fcf8 from "../assets/cf8252b787d9d4b7.webp";
import __studioImage55fe09eb from "../assets/ac4fdf724e55bd2f.webp";
import { SaasTrialHero2 } from "../saas-trial-hero-2";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error"];
type SpecimenState = "default" | "hover" | "active" | "disabled" | "error";
export default function SaasTrialHero2Specimen({ state = "default" }: { state?: SpecimenState }) {
const sample = defaults.sample;
return (
<SaasTrialHero2
state={state}
headline="Your whole week of shifts, sorted before Monday"
highlight="sorted before Monday"
lead="Slide the handle and watch the Sunday-night spreadsheet turn into a schedule your whole team can read."
beforeImage={slot(
"before",
__studioImage0e61fcf8
)}
beforeAlt="A crowded spreadsheet roster with clashing colours and crossed-out shifts"
afterImage={slot(
"screenshot",
__studioImage55fe09eb
)}
afterAlt="The same week in Shiftly: a tidy colour-coded shift calendar with one open shift flagged"
beforeLabel="Before"
beforeCaption="The Sunday-night spreadsheet"
afterLabel="After"
afterCaption="The same week in Shiftly"
hint="Drag the handle, or use your arrow keys, to see the same week both ways."
actionTitle="Get your Sunday nights back"
points={[
{ lead: "No more rebuilding the rota.", body: "Copy last week, drag a few shifts, and next week is done." },
{ lead: "Gaps show up before service.", body: "Every uncovered shift is flagged red, so you fix it before the rush, not during it." },
{ lead: "Swaps leave the group chat.", body: "Staff trade shifts in the app and you approve them in one tap." },
]}
price={sample.price}
priceTerm="a month after your trial"
priceBreakdown="About $1.57 a day"
emailLabel="Your work email"
emailPlaceholder="you@yourrestaurant.com"
commitLabel={`I understand I'm covered by the ${sample.guarantee}.`}
buttonLabel="Start My Shiftly Trial"
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalSaasTrialHero2 |
string |
|
highlight OptionalSaasTrialHero2 |
string |
|
lead OptionalSaasTrialHero2 |
string |
|
beforeImage OptionalSaasTrialHero2 |
string |
|
beforeAlt OptionalSaasTrialHero2 |
string |
|
afterImage OptionalSaasTrialHero2 |
string |
|
afterAlt OptionalSaasTrialHero2 |
string |
|
beforeLabel OptionalSaasTrialHero2 |
string |
|
beforeCaption OptionalSaasTrialHero2 |
string |
|
afterLabel OptionalSaasTrialHero2 |
string |
|
afterCaption OptionalSaasTrialHero2 |
string |
|
startPosition OptionalSaasTrialHero2 |
number |
|
hint OptionalSaasTrialHero2 |
string |
|
actionTitle OptionalSaasTrialHero2 |
string |
|
points OptionalSaasTrialHero2 |
SaasTrialHero2Point[] |
|
price OptionalSaasTrialHero2 |
string |
|
priceTerm OptionalSaasTrialHero2 |
string |
|
priceBreakdown OptionalSaasTrialHero2 |
string |
|
emailLabel OptionalSaasTrialHero2 |
string |
|
emailPlaceholder OptionalSaasTrialHero2 |
string |
|
commitLabel OptionalSaasTrialHero2 |
string |
|
buttonLabel OptionalSaasTrialHero2 |
string |
|
note OptionalSaasTrialHero2 |
string |
|
copy OptionalSaasTrialHero2 |
{
required?: string;
invalid?: string;
commit?: string;
slider?: string;
sliderValue?: string;
} |
|
onSubmit OptionalSaasTrialHero2 |
(values: { email: string }) => void |
|
onAction OptionalSaasTrialHero2 |
() => void |
|
state OptionalSaasTrialHero2 |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalSaasTrialHero2 |
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.
before- An image this piece places.
screenshot- An image this piece places.
-
ac4fdf724e55bd2f.webp
image/webp · 25 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
cf8252b787d9d4b7.webp
image/webp · 261 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB