Swipe Emails 1
JV swipe-email bank: affiliates pick an email, paste their link once and copy a ready-to-send promo in one click.
Use it in a prompt
Use jv/swipe-emails 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/jv/swipe-emails.tsx. - Import it and pass your copy and images (Props tab):
import { SwipeEmails } from "@/components/funneldna/jv/swipe-emails"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/jv/swipe-emails/component.tsx 549 lines
// layout: diagonal-split
// JV swipe-email bank: affiliates pick an email, paste their link once and copy a ready-to-send promo in one click.
import * as React from "react"
import { AlertCircle, Check, Copy, Link2 } from "lucide-react"
export type SwipeEmail = {
/** Short tab name, e.g. "Introduction". */
label: string
subject: string
/** Plain-text paragraphs; write {link} where the affiliate link goes. */
body: string[]
}
export type SwipeEmailsProps = {
heading?: string
subheading?: string
/** The swipe emails, one tab each. An empty list falls back to the approved set. */
emails?: SwipeEmail[]
/** Accessible name for the email tabs. */
tablistLabel?: string
linkLabel?: string
/** Example link shown in the empty field. */
linkPlaceholder?: string
/** Helper line under the link field. */
linkHint?: string
/** Inline error when the pasted link is not a full http(s) address. */
linkError?: string
/** Highlighted stand-in shown wherever {link} appears until a link is pasted. */
linkToken?: string
/** Label before the subject line, also used as the prefix in copied text. */
subjectLabel?: string
copySubjectLabel?: string
copiedSubjectLabel?: string
copyLabel?: string
copiedLabel?: string
/** Shown when the browser blocks clipboard access. */
copyFailedLabel?: string
/** Reassurance line beside the main copy button. */
copyNote?: string
/** Accessible label for each tab's copy button; {number} and {label} are replaced. */
rowCopyLabel?: string
/** Screen-reader announcement after a copy; {label} is replaced. */
copiedAnnouncement?: string
/** Link the field starts with. */
defaultLink?: string
/** Sample invalid link pre-filled in the error state preview. */
errorLink?: string
/** Tab selected on first render (zero-based). */
defaultIndex?: number
disabled?: boolean
state?: "default" | "hover" | "active" | "disabled" | "error" | "success"
/** Called on every copy with the exact text sent to the clipboard. */
onCopy?: (copy: { index: number; part: "email" | "subject"; text: string; link: string }) => void
/** Called with the raw field value on every edit. */
onLinkChange?: (link: string) => void
className?: string
}
const DEFAULT_EMAILS: SwipeEmail[] = [
{
label: "Introduction",
subject: "Your first funnel starts with a clear plan",
body: [
"Hi [First name],",
"Building your first funnel? Start with a clear plan.",
"The Funnel Starter Kit helps you plan your funnel, write your page copy, and check every step before you launch.",
"Get the guide, workbook, and checklist in one download for $47. One payment. Lifetime access.",
"Take a look: {link}",
"[Your name]",
],
},
{
label: "The plan",
subject: "The 3-part plan for your first funnel",
body: [
"Hi [First name],",
"A first funnel gets a lot easier when you know what to do first, second and third.",
"The Funnel Starter Kit lays it out in three parts:",
"1. Map your offer and the pages your funnel needs.",
"2. Draft your headline, offer, and call to action.",
"3. Review the links, forms, and next steps before launch.",
"See the full plan here: {link}",
"[Your name]",
],
},
{
label: "What's inside",
subject: "What's inside the Funnel Starter Kit",
body: [
"Hi [First name],",
"Here's everything you get in the Funnel Starter Kit:",
"Funnel Planning Guide ($49 value)",
"Page Copy Workbook ($29 value)",
"Launch Checklist ($19 value)",
"That's $97 in total value. You won't pay that. The complete kit is $47, one payment, and it's yours to keep.",
"Get the kit: {link}",
"[Your name]",
],
},
{
label: "Reminder",
subject: "Still planning your first funnel?",
body: [
"Hi [First name],",
"Quick reminder about the Funnel Starter Kit.",
"If your first funnel is still an idea, this gets you a plan, your page copy, and a launch checklist in one download.",
"It's $47, one payment, with a 30-day money-back guarantee.",
"Grab it here: {link}",
"[Your name]",
],
},
]
export function SwipeEmails(props: SwipeEmailsProps) {
const {
heading = "Ready-to-send emails",
subheading = "Pick an email. Paste your link once. Copy it and send.",
emails = DEFAULT_EMAILS,
tablistLabel = "Swipe emails",
linkLabel = "Your affiliate link",
linkPlaceholder = "https://yoursite.com/go/funnel-kit",
linkHint = "Paste it once. It drops into every email.",
linkError = "Enter your full link, starting with https://",
linkToken = "[YOUR AFFILIATE LINK]",
subjectLabel = "Subject",
copySubjectLabel = "Copy subject",
copiedSubjectLabel = "Copied",
copyLabel = "Copy This Email",
copiedLabel = "Email copied",
copyFailedLabel = "Your browser blocked the copy. Select the email text and copy it by hand.",
copyNote = "Subject, body and your link copy together.",
rowCopyLabel = "Copy email {number}: {label}",
copiedAnnouncement = "Copied: {label}",
defaultLink = "",
errorLink = "yoursite.com/go",
defaultIndex = 0,
disabled = false,
state = "default",
onCopy,
onLinkChange,
className,
} = props
const uid = React.useId().replace(/:/g, "")
const list = emails.length > 0 ? emails : DEFAULT_EMAILS
const locked = disabled || state === "disabled"
const start = Math.min(Math.max(0, defaultIndex), list.length - 1)
const [active, setActive] = React.useState(start)
const [link, setLink] = React.useState(state === "error" ? errorLink : defaultLink)
const [touched, setTouched] = React.useState(state === "error")
const [copied, setCopied] = React.useState<string | null>(state === "success" ? "email-" + start : null)
const [failed, setFailed] = React.useState(false)
const [announce, setAnnounce] = React.useState("")
const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([])
const inputRef = React.useRef<HTMLInputElement>(null)
const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null)
React.useEffect(
() => () => {
if (timer.current) clearTimeout(timer.current)
},
[]
)
const current = Math.min(active, list.length - 1)
const email = list[current]
const trimmed = link.trim()
const valid = trimmed === "" || isLink(trimmed)
const showError = touched && !valid
const filled = trimmed !== "" && valid ? trimmed : ""
const hintId = uid + "-hint"
const panelId = uid + "-panel"
const force = state === "hover" || state === "active" ? state : undefined
async function copy(index: number, part: "email" | "subject") {
if (locked) return
if (!valid) {
setTouched(true)
inputRef.current?.focus()
return
}
const item = list[index]
const text = part === "subject" ? item.subject : compose(item, filled || linkToken, subjectLabel)
setActive(index)
let ok = false
try {
if (!navigator.clipboard) throw new Error("clipboard")
await navigator.clipboard.writeText(text)
ok = true
} catch {
ok = false
}
onCopy?.({ index, part, text, link: filled })
if (timer.current) clearTimeout(timer.current)
setFailed(!ok)
if (!ok) {
setCopied(null)
return
}
setCopied(part + "-" + index)
setAnnounce(fill(copiedAnnouncement, { label: part === "subject" ? subjectLabel : item.label }))
timer.current = setTimeout(() => setCopied(null), 2400)
}
function onTabKey(event: React.KeyboardEvent<HTMLButtonElement>, index: number) {
const last = list.length - 1
let next = -1
if (event.key === "ArrowDown" || event.key === "ArrowRight") next = index === last ? 0 : index + 1
else if (event.key === "ArrowUp" || event.key === "ArrowLeft") next = index === 0 ? last : index - 1
else if (event.key === "Home") next = 0
else if (event.key === "End") next = last
if (next < 0) return
event.preventDefault()
setActive(next)
tabRefs.current[next]?.focus()
}
const emailCopied = copied === "email-" + current
const subjectCopied = copied === "subject-" + current
return (
<div className={"cf-swipe-emails" + (className ? " " + className : "")} data-state={state}>
<style>{CSS}</style>
<div className="se-side">
<h2 className="se-title">{heading}</h2>
<p className="se-sub">{subheading}</p>
<div className="se-tabs" style={{ gridTemplateRows: "repeat(" + list.length + ", auto)" }}>
<div className="se-tablist" role="tablist" aria-label={tablistLabel} aria-orientation="vertical">
{list.map((item, i) => {
const on = i === current
return (
<button
key={i}
ref={(node) => {
tabRefs.current[i] = node
}}
type="button"
role="tab"
id={uid + "-tab-" + i}
aria-selected={on}
aria-controls={panelId}
tabIndex={on ? 0 : -1}
className="se-tab"
onClick={() => setActive(i)}
onKeyDown={(event) => onTabKey(event, i)}
>
<span className="se-num" aria-hidden="true">
{pad(i)}
</span>
<span className="se-tabtext">
<span className="se-tablabel">{item.label}</span>
<span className="se-tabsubj">{item.subject}</span>
</span>
</button>
)
})}
</div>
<div className="se-rowcopies">
{list.map((item, i) => (
<button
key={i}
type="button"
className="se-rowcopy"
data-active={i === current ? "" : undefined}
aria-label={fill(rowCopyLabel, { number: String(i + 1), label: item.label })}
disabled={locked}
onClick={() => copy(i, "email")}
>
{copied === "email-" + i ? (
<Check className="se-pop" aria-hidden="true" />
) : (
<Copy aria-hidden="true" />
)}
</button>
))}
</div>
</div>
</div>
<div className="se-main">
<div className="se-field">
<label className="se-label" htmlFor={uid + "-link"}>
{linkLabel}
</label>
<div
className="se-input"
data-invalid={showError ? "" : undefined}
data-disabled={locked ? "" : undefined}
>
<Link2 aria-hidden="true" />
<input
ref={inputRef}
id={uid + "-link"}
className="se-control"
type="url"
inputMode="url"
autoComplete="url"
spellCheck={false}
placeholder={linkPlaceholder}
value={link}
disabled={locked}
aria-invalid={showError}
aria-describedby={hintId}
onChange={(event) => {
setLink(event.target.value)
setFailed(false)
onLinkChange?.(event.target.value)
}}
onBlur={() => setTouched(true)}
/>
</div>
{showError ? (
<p id={hintId} className="se-error" role="alert">
<AlertCircle aria-hidden="true" />
<span>{linkError}</span>
</p>
) : (
<p id={hintId} className="se-hint">
{linkHint}
</p>
)}
</div>
<div
key={current}
className="se-panel"
role="tabpanel"
id={panelId}
aria-labelledby={uid + "-tab-" + current}
tabIndex={0}
>
<div className="se-subject">
<div className="se-subject-text">
<span className="se-subject-label">{subjectLabel}</span>
<p className="se-subject-line">{email.subject}</p>
</div>
<button type="button" className="se-btn2" disabled={locked} onClick={() => copy(current, "subject")}>
{subjectCopied ? <Check className="se-pop" aria-hidden="true" /> : <Copy aria-hidden="true" />}
<span>{subjectCopied ? copiedSubjectLabel : copySubjectLabel}</span>
</button>
</div>
<div className="se-well">
{email.body.map((para, p) => (
<p key={p}>
{para.split("{link}").map((chunk, c, all) => (
<React.Fragment key={c}>
{chunk}
{c < all.length - 1 ? (
<mark className="se-link" data-filled={filled ? "" : undefined}>
{filled || linkToken}
</mark>
) : null}
</React.Fragment>
))}
</p>
))}
</div>
</div>
<div className="se-actions">
<button
type="button"
className="se-cta"
data-force={force}
data-copied={emailCopied ? "" : undefined}
disabled={locked}
onClick={() => copy(current, "email")}
>
{emailCopied ? <Check className="se-pop" aria-hidden="true" /> : <Copy aria-hidden="true" />}
<span>{emailCopied ? copiedLabel : copyLabel}</span>
</button>
<p className="se-note">{copyNote}</p>
{failed ? (
<p className="se-error" role="alert">
<AlertCircle aria-hidden="true" />
<span>{copyFailedLabel}</span>
</p>
) : null}
</div>
<span className="se-sr" role="status">
{announce}
</span>
</div>
</div>
)
}
export default SwipeEmails
function isLink(value: string) {
try {
const url = new URL(value)
return (url.protocol === "https:" || url.protocol === "http:") && url.hostname.includes(".")
} catch {
return false
}
}
function compose(email: SwipeEmail, link: string, subjectLabel: string) {
const NL = "\n"
const body = email.body.map((para) => para.split("{link}").join(link))
return subjectLabel + ": " + email.subject + NL + NL + body.join(NL + NL)
}
function fill(template: string, values: Record<string, string>) {
return Object.keys(values).reduce((text, key) => text.split("{" + key + "}").join(values[key]), template)
}
function pad(index: number) {
return String(index + 1).padStart(2, "0")
}
// Theme: every colour, face, button, field and card reads the theme tokens (theme-contract.md). The marker default
// (#fae37c) is the documented highlighter fallback. No images, so no slots.
// The reduced-motion block keeps !important: panel and icon animations are set by more specific selectors
// (.cf-swipe-emails .se-panel / .se-pop), so plain declarations would not override them.
const CSS = `
.cf-swipe-emails{
--se-ink:var(--ink,oklch(0.21 0.034 263));
--se-muted:var(--muted,oklch(0.446 0.03 258));
--se-card:var(--card,oklch(1 0 0));
--se-band:var(--band,oklch(0.273 0.067 256));
--se-band-ink:var(--band-ink,oklch(1 0 0));
--se-accent:var(--accent,oklch(0.5 0.171 257));
--se-focus:var(--field-focus,var(--accent,oklch(0.5 0.171 257)));
--se-field:var(--field,oklch(1 0 0));
--se-field-ink:var(--field-ink,oklch(0.21 0.034 263));
--se-danger:var(--danger,oklch(0.5 0.17 27));
--se-danger-soft:var(--danger-soft,oklch(0.93 0.024 27));
--se-secondary:var(--secondary,oklch(0.93 0.015 263));
--se-secondary-ink:var(--secondary-ink,oklch(0.21 0.034 263));
--se-btn:var(--button-bg,var(--cta,oklch(0.576 0.209 29.5)));
--se-btn-2:var(--button-bg-2,var(--cta-2,oklch(0.506 0.206 29.5)));
--se-btn-ink:var(--button-ink,var(--cta-ink,oklch(1 0 0)));
--se-r:var(--radius,0.75rem);
--se-shadow:var(--shadow,oklch(0.22 0.03 256));
--se-shadow-sm:var(--shadow-sm,0 1px 1px oklch(from var(--se-shadow) l c h / .18),0 1px 3px oklch(from var(--se-shadow) l c h / .14));
--se-shadow-md:var(--shadow-md,0 1px 2px oklch(from var(--se-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--se-shadow) l c h / .2));
--se-marker:var(--marker,#fae37c);
--se-marker-ink:var(--field-ink,oklch(0.21 0.034 263));
--se-diag:3.5rem;
--se-stripe:.4rem;
position:relative;isolation:isolate;display:grid;grid-template-columns:minmax(0,22.5rem) minmax(0,1fr);
width:100%;max-width:72rem;margin-inline:auto;overflow:hidden;
background:var(--se-card);color:var(--se-ink);
border:1px solid var(--card-border,color-mix(in oklch,var(--se-ink) 12%,transparent));
border-radius:var(--card-radius,calc(var(--se-r) * 1.4));
box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--se-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--se-shadow) l c h / .32)));
font-family:var(--font-body,sans-serif);font-size:1rem;line-height:1.5;text-align:left;
}
.cf-swipe-emails,.cf-swipe-emails *,.cf-swipe-emails *::before,.cf-swipe-emails *::after{box-sizing:border-box}
.cf-swipe-emails :focus-visible{outline:3px solid var(--se-focus);outline-offset:3px}
.cf-swipe-emails .se-side :focus-visible{outline-color:var(--se-band-ink)}
.cf-swipe-emails .se-side{position:relative;z-index:1;min-width:0;padding:2.75rem 1.75rem 2.75rem 2.25rem;background:var(--se-band);color:var(--se-band-ink)}
.cf-swipe-emails .se-side::before{content:'';position:absolute;z-index:-1;inset:0 calc(var(--se-diag) * -1) 0 0;background:var(--se-band);clip-path:polygon(0 0,100% 0,calc(100% - var(--se-diag)) 100%,0 100%)}
.cf-swipe-emails .se-side::after{content:'';position:absolute;z-index:-1;inset:0 calc((var(--se-diag) + var(--se-stripe)) * -1) 0 0;background:var(--accent-fill,var(--se-accent));clip-path:polygon(calc(100% - var(--se-stripe)) 0,100% 0,calc(100% - var(--se-diag)) 100%,calc(100% - var(--se-diag) - var(--se-stripe)) 100%)}
.cf-swipe-emails .se-title{margin:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.02em);font-size:clamp(2rem,3.4vw,2.75rem);line-height:1.02;text-wrap:balance}
.cf-swipe-emails .se-sub{margin:.85rem 0 0;font-size:1.0625rem;font-weight:500;line-height:1.45;color:color-mix(in oklch,var(--se-band-ink) 86%,var(--se-band));text-wrap:pretty}
.cf-swipe-emails .se-tabs{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.6rem;margin-top:2rem}
.cf-swipe-emails .se-tablist,.cf-swipe-emails .se-rowcopies{display:grid;grid-row:1 / -1;grid-template-rows:subgrid;min-width:0}
.cf-swipe-emails .se-tablist{grid-column:1}
.cf-swipe-emails .se-rowcopies{grid-column:2}
.cf-swipe-emails .se-tab{display:flex;align-items:flex-start;gap:.8rem;width:100%;min-width:0;min-height:3.9rem;margin:0;padding:.8rem 1rem;border:1px solid oklch(from var(--se-band-ink) l c h / .16);border-radius:var(--button-radius,var(--se-r));background:oklch(from var(--se-band) calc(l + .05) c h);color:var(--se-band-ink);font:inherit;text-align:left;cursor:pointer;transition:background-color .18s ease,color .18s ease,box-shadow .18s ease}
.cf-swipe-emails .se-tab:hover{background:oklch(from var(--se-band) calc(l + .1) c h)}
.cf-swipe-emails .se-tab[aria-selected='true']{background:var(--se-card);color:var(--se-ink);border-color:transparent;box-shadow:var(--se-shadow-md)}
.cf-swipe-emails .se-num{flex:none;min-width:1.6rem;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:1rem;line-height:1.35;font-variant-numeric:tabular-nums}
.cf-swipe-emails .se-tab[aria-selected='true'] .se-num{color:var(--se-accent)}
.cf-swipe-emails .se-tabtext{display:grid;gap:.15rem;min-width:0}
.cf-swipe-emails .se-tablabel{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:1.0625rem;line-height:1.3}
.cf-swipe-emails .se-tabsubj{font-size:.9375rem;line-height:1.35;color:color-mix(in oklch,var(--se-band-ink) 80%,var(--se-band));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cf-swipe-emails .se-tab[aria-selected='true'] .se-tabsubj{color:var(--se-muted)}
.cf-swipe-emails .se-rowcopy{display:grid;place-items:center;width:3rem;min-height:2.75rem;margin:0;padding:0;border:1px solid oklch(from var(--se-band-ink) l c h / .22);border-radius:var(--button-radius,var(--se-r));background:oklch(from var(--se-band) calc(l + .05) c h);color:var(--se-band-ink);cursor:pointer;transition:background-color .15s ease,transform .15s ease}
.cf-swipe-emails .se-rowcopy svg{width:1.15rem;height:1.15rem}
.cf-swipe-emails .se-rowcopy:hover:not(:disabled){background:oklch(from var(--se-band) calc(l + .1) c h)}
.cf-swipe-emails .se-rowcopy:active:not(:disabled){transform:translateY(1px)}
.cf-swipe-emails .se-rowcopy[data-active]{background:var(--se-card);color:var(--se-ink);border-color:transparent;box-shadow:var(--se-shadow-sm)}
.cf-swipe-emails .se-rowcopy[data-active]:hover:not(:disabled){background:color-mix(in oklch,var(--se-ink) 6%,var(--se-card))}
.cf-swipe-emails .se-main{position:relative;z-index:2;min-width:0;display:grid;align-content:start;gap:1.75rem;padding:2.75rem 2.5rem 2.5rem calc(var(--se-diag) + var(--se-stripe) + 1.75rem)}
.cf-swipe-emails .se-label{display:block;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:1.0625rem;line-height:1.3;color:var(--label-ink,var(--se-ink))}
.cf-swipe-emails .se-input{display:flex;align-items:center;gap:.65rem;margin-top:.55rem;min-height:3.25rem;padding:0 1rem;background:var(--field,oklch(1 0 0));color:var(--field-ink,oklch(0.21 0.034 263));border:1.5px solid var(--field-border,color-mix(in oklch,var(--se-ink) 22%,transparent));border-radius:var(--field-radius,var(--se-r));box-shadow:inset 0 1px 2px oklch(from var(--se-shadow) l c h / .08);transition:border-color .15s ease,box-shadow .15s ease}
.cf-swipe-emails .se-input:focus-within{border-color:var(--se-focus);box-shadow:0 0 0 3px oklch(from var(--se-focus) l c h / .25)}
.cf-swipe-emails .se-input[data-invalid]{border-color:var(--se-danger)}
.cf-swipe-emails .se-input[data-invalid]:focus-within{box-shadow:0 0 0 3px oklch(from var(--se-danger) l c h / .22)}
.cf-swipe-emails .se-input[data-disabled]{opacity:.6}
.cf-swipe-emails .se-input svg{flex:none;width:1.15rem;height:1.15rem;color:color-mix(in oklch,var(--se-field-ink) 70%,var(--se-field))}
.cf-swipe-emails .se-input .se-control{flex:1 1 auto;min-width:0;height:3rem;margin:0;padding:0;border:0;outline:0;background:var(--field,oklch(1 0 0));color:var(--field-ink,oklch(0.21 0.034 263));font:inherit;font-size:1.0625rem;font-weight:600}
.cf-swipe-emails .se-input .se-control::placeholder{color:color-mix(in oklch,var(--field-ink,oklch(0.21 0.034 263)) 65%,var(--field,oklch(1 0 0)));opacity:1;font-weight:500}
.cf-swipe-emails .se-input .se-control:disabled{cursor:not-allowed}
.cf-swipe-emails .se-hint{margin:.55rem 0 0;font-size:.9375rem;line-height:1.4;color:var(--se-muted);text-wrap:pretty}
.cf-swipe-emails .se-error{display:flex;align-items:flex-start;gap:.5rem;margin:.6rem 0 0;padding:.55rem .8rem;border-radius:var(--se-r);background:var(--se-danger-soft);color:var(--se-danger);font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
.cf-swipe-emails .se-error svg{flex:none;width:1.1rem;height:1.1rem;margin-top:.1rem}
.cf-swipe-emails .se-panel{min-width:0;border-radius:var(--se-r);outline-offset:6px;animation:se-in .3s cubic-bezier(.2,.7,.2,1) both}
.cf-swipe-emails .se-subject{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1.25rem}
.cf-swipe-emails .se-subject-text{display:flex;flex-wrap:wrap;align-items:baseline;gap:.25rem .9rem;min-width:0;flex:1 1 18rem}
.cf-swipe-emails .se-subject-label{font-size:.875rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--se-muted)}
.cf-swipe-emails .se-subject-line{margin:0;min-width:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3rem,2.1vw,1.65rem);line-height:1.2;letter-spacing:var(--display-tracking,-.01em);text-wrap:balance;color:var(--se-ink)}
.cf-swipe-emails .se-btn2{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;flex:none;min-height:2.75rem;margin:0;padding:.55rem 1.05rem;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--se-r));background:var(--button-2-bg,var(--se-secondary));color:var(--button-2-ink,var(--se-secondary-ink));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:.9375rem;line-height:1.2;white-space:nowrap;box-shadow:var(--button-2-shadow, var(--shadow-sm));cursor:pointer;transition:background-color .15s ease,transform .15s ease}
.cf-swipe-emails .se-btn2 svg{width:1rem;height:1rem}
.cf-swipe-emails .se-btn2:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--se-secondary)) calc(l - .04) c h)}
.cf-swipe-emails .se-btn2:active:not(:disabled){transform:translateY(1px)}
.cf-swipe-emails .se-well{display:grid;gap:.95rem;margin-top:1rem;padding:1.5rem 1.6rem;border-radius:var(--se-r);background:color-mix(in oklch,var(--se-ink) 4%,var(--se-card));color:var(--se-ink);font-size:1.0625rem;line-height:1.6}
.cf-swipe-emails .se-well p{margin:0;text-wrap:pretty;overflow-wrap:anywhere}
.cf-swipe-emails .se-link{color:var(--se-marker-ink);background-color:transparent;background-image:linear-gradient(178deg,transparent 0 14%,var(--se-marker) 14% 95%,transparent 95%);padding:.05em .32em;margin:0 -.04em;border-radius:.22em .45em .3em .5em;font-weight:800;letter-spacing:.01em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-swipe-emails .se-link[data-filled]{font-weight:700;letter-spacing:0}
.cf-swipe-emails .se-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.9rem 1.5rem}
.cf-swipe-emails .se-cta{display:inline-flex;align-items:center;justify-content:center;gap:.6rem;min-width:16rem;min-height:3.75rem;margin:0;padding:.9rem 1.9rem;border:1px solid oklch(from var(--se-btn-2) calc(l - .06) c h);border-radius:var(--button-radius,var(--se-r));background:linear-gradient(oklch(from var(--se-btn) calc(l + .04) c h),oklch(from var(--se-btn-2) calc(l - .01) c h));color:var(--se-btn-ink);font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:1.25rem;line-height:1.1;letter-spacing:-.01em;text-shadow:var(--button-text-shadow,none);white-space:nowrap;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--se-btn) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--se-btn-2) calc(l - .12) c h),var(--se-shadow-md));cursor:pointer;transition:transform .14s ease,box-shadow .14s ease,background .14s ease}
.cf-swipe-emails .se-cta svg{flex:none;width:1.3rem;height:1.3rem}
.cf-swipe-emails .se-cta:hover:not(:disabled),.cf-swipe-emails .se-cta[data-force='hover']{transform:translateY(-1px);background:linear-gradient(oklch(from var(--se-btn) calc(l - .02) c h),oklch(from var(--se-btn-2) calc(l - .06) c h))}
.cf-swipe-emails .se-cta:active:not(:disabled),.cf-swipe-emails .se-cta[data-force='active']{transform:translateY(1px);background:linear-gradient(oklch(from var(--se-btn-2) calc(l - .02) c h),oklch(from var(--se-btn-2) calc(l - .06) c h));box-shadow:inset 0 2px 3px oklch(from var(--se-btn-2) calc(l - .22) c h / .55),var(--se-shadow-sm)}
.cf-swipe-emails .se-cta:disabled,.cf-swipe-emails .se-btn2:disabled,.cf-swipe-emails .se-rowcopy:disabled{cursor:not-allowed;opacity:.55;transform:none}
.cf-swipe-emails .se-note{flex:1 1 13rem;margin:0;font-size:.9375rem;line-height:1.45;color:var(--se-muted);text-wrap:pretty}
.cf-swipe-emails .se-actions .se-error{flex:1 1 100%;margin:0}
.cf-swipe-emails .se-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.cf-swipe-emails .se-pop{animation:se-pop .32s ease-out both}
@keyframes se-in{from{opacity:.55;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes se-pop{0%{transform:scale(.6)}60%{transform:scale(1.15)}100%{transform:scale(1)}}
@media (max-width:900px){
.cf-swipe-emails{grid-template-columns:minmax(0,1fr);--se-diag:2.25rem}
.cf-swipe-emails .se-side{padding:2.25rem 1.5rem 1.75rem}
.cf-swipe-emails .se-side::before{inset:0 0 calc(var(--se-diag) * -1) 0;clip-path:polygon(0 0,100% 0,100% calc(100% - var(--se-diag)),0 100%)}
.cf-swipe-emails .se-side::after{inset:0 0 calc((var(--se-diag) + var(--se-stripe)) * -1) 0;clip-path:polygon(0 calc(100% - var(--se-stripe)),100% calc(100% - var(--se-diag) - var(--se-stripe)),100% calc(100% - var(--se-diag)),0 100%)}
.cf-swipe-emails .se-main{padding:calc(var(--se-diag) + var(--se-stripe) + 1.5rem) 1.5rem 1.75rem}
}
@media (max-width:560px){
.cf-swipe-emails{--se-diag:1.75rem}
.cf-swipe-emails .se-side{padding:1.75rem 1.125rem 1.5rem}
.cf-swipe-emails .se-main{gap:1.5rem;padding-inline:1.125rem;padding-bottom:1.5rem}
.cf-swipe-emails .se-tabs{margin-top:1.5rem;gap:.5rem}
.cf-swipe-emails .se-tab{gap:.6rem;min-height:3.5rem;padding:.7rem .8rem}
.cf-swipe-emails .se-subject-text{flex-basis:100%}
.cf-swipe-emails .se-well{padding:1.15rem 1.05rem}
.cf-swipe-emails .se-cta{width:100%;min-width:0;font-size:1.1875rem}
.cf-swipe-emails .se-note{text-align:center}
}
@media (prefers-reduced-motion:reduce){
.cf-swipe-emails *,.cf-swipe-emails *::before,.cf-swipe-emails *::after{animation:none !important;transition:none !important}
}
`
pieces/jv/swipe-emails/specimen.tsx 68 lines
import { SwipeEmails, type SwipeEmail, type SwipeEmailsProps } from "../swipe-emails"
import defaults from "../../studio-defaults.json"
const s = defaults.sample
const [guide, workbook, checklist] = s.items
const lead = s.lead.charAt(0).toLowerCase() + s.lead.slice(1)
const note = s.note.split(" · ").join(". ") + "."
const emails: SwipeEmail[] = [
{
label: "Introduction",
subject: "Your first funnel starts with a clear plan",
body: [
"Hi [First name],",
"Building your first funnel? Start with a clear plan.",
`${s.name} helps you ${lead}`,
`Get the guide, workbook, and checklist in one download for ${s.price}. ${note}`,
"Take a look: {link}",
"[Your name]",
],
},
{
label: "The plan",
subject: "The 3-part plan for your first funnel",
body: [
"Hi [First name],",
"A first funnel gets a lot easier when you know what to do first, second and third.",
`${s.name} lays it out in three parts:`,
`1. ${guide.detail}`,
`2. ${workbook.detail}`,
`3. ${checklist.detail}`,
"See the full plan here: {link}",
"[Your name]",
],
},
{
label: "What's inside",
subject: `What's inside ${s.name}`,
body: [
"Hi [First name],",
`Here's everything you get in ${s.name}:`,
`${guide.name} (${guide.value} value)`,
`${workbook.name} (${workbook.value} value)`,
`${checklist.name} (${checklist.value} value)`,
`That's ${s.regularPrice} in total value. You won't pay that. The complete kit is ${s.price}, one payment, and it's yours to keep.`,
"Get the kit: {link}",
"[Your name]",
],
},
{
label: "Reminder",
subject: "Still planning your first funnel?",
body: [
"Hi [First name],",
`Quick reminder about ${s.name}.`,
"If your first funnel is still an idea, this gets you a plan, your page copy, and a launch checklist in one download.",
`It's ${s.price}, one payment, with a ${s.guarantee}.`,
"Grab it here: {link}",
"[Your name]",
],
},
]
export const states = ["default", "hover", "active", "disabled", "error", "success"] as const
export default function SwipeEmailsSpecimen({ state = "default" }: { state?: SwipeEmailsProps["state"] }) {
return <SwipeEmails key={state} state={state} emails={emails} />
}
| Name | Type | Details |
|---|---|---|
heading OptionalSwipeEmails |
string |
|
subheading OptionalSwipeEmails |
string |
|
emails OptionalSwipeEmails |
SwipeEmail[] |
|
tablistLabel OptionalSwipeEmails |
string |
|
linkLabel OptionalSwipeEmails |
string |
|
linkPlaceholder OptionalSwipeEmails |
string |
|
linkHint OptionalSwipeEmails |
string |
|
linkError OptionalSwipeEmails |
string |
|
linkToken OptionalSwipeEmails |
string |
|
subjectLabel OptionalSwipeEmails |
string |
|
copySubjectLabel OptionalSwipeEmails |
string |
|
copiedSubjectLabel OptionalSwipeEmails |
string |
|
copyLabel OptionalSwipeEmails |
string |
|
copiedLabel OptionalSwipeEmails |
string |
|
copyFailedLabel OptionalSwipeEmails |
string |
|
copyNote OptionalSwipeEmails |
string |
|
rowCopyLabel OptionalSwipeEmails |
string |
|
copiedAnnouncement OptionalSwipeEmails |
string |
|
defaultLink OptionalSwipeEmails |
string |
|
errorLink OptionalSwipeEmails |
string |
|
defaultIndex OptionalSwipeEmails |
number |
|
disabled OptionalSwipeEmails |
boolean |
|
state OptionalSwipeEmails |
"default" | "hover" | "active" | "disabled" | "error" | "success" |
|
onCopy OptionalSwipeEmails |
(copy: { index: number; part: "email" | "subject"; text: string; link: string }) => void |
|
onLinkChange OptionalSwipeEmails |
(link: string) => void |
|
className OptionalSwipeEmails |
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.
--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.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB