Referral Share 6
Refer-a-friend for a local practice: a three-stop path (share, friend books, you both win) above an angled band where channel tabs preview the ready-written note live, so sending a referral feels easy and normal.
Use it in a prompt
Use checkout/referral-share-6 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/checkout/referral-share-6.tsx. - Import it and pass your copy and images (Props tab):
import { ReferralShare6 } from "@/components/funneldna/checkout/referral-share-6"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/referral-share-6/component.tsx 889 lines
// layout: diagonal-split
// Refer-a-friend for a local practice: a three-stop path (share, friend books, you both win) above an angled band where channel tabs preview the ready-written note live, so sending a referral feels easy and normal.
import * as React from 'react'
import {
CalendarCheck,
Check,
CircleAlert,
Copy,
Gift,
HeartHandshake,
Link2,
Lock,
Mail,
MessageSquareText,
Send,
} from 'lucide-react'
export type ReferralShare6Channel = 'text' | 'email' | 'copy'
export type ReferralShare6Copy = {
/** Salutation when patientName is set; {name} is replaced. */
salutation: string
/** Salutation when no name is given. */
salutationAnon: string
headlineStart: string
/** The phrase under the marker stroke. */
headlineMark: string
headlineEnd: string
/** Letter paragraphs; {practice} is replaced. */
paragraphs: string[]
signOff: string
/** Sign-off name; {practice} is replaced. */
signer: string
/** Accessible name of the three-stop path. */
pathLabel: string
shareTitle: string
shareDetail: string
bookTitle: string
/** {practice} is replaced. */
bookDetail: string
/** Third stop when a reward is supplied; {reward} is replaced. */
rewardTitle: string
rewardDetail: string
/** Third stop when no reward is supplied. */
careTitle: string
careDetail: string
sendHeadline: string
sendLead: string
linkLabel: string
/** Accessible name of the channel tabs. */
tabsLabel: string
tabs: Record<ReferralShare6Channel, string>
noteLabel: string
notePlaceholder: string
noteError: string
linkAdded: string
actions: Record<ReferralShare6Channel, string>
copiedLabel: string
copiedAnnounce: string
copyError: string
hints: Record<ReferralShare6Channel, string>
previewLabel: string
toLine: string
fromLine: string
subjectLabel: string
/** Email subject; {practice} is replaced. */
subject: string
pastedLine: string
/** Prefilled note without a reward; {practice} is replaced. */
message: string
/** Prefilled note with a reward; {practice} and {reward} are replaced. */
messageWithReward: string
}
export type ReferralShare6Props = {
/** The visitor’s personal referral link; added to the end of every message. */
link: string
/** The supplied reward you both get, e.g. a $25 credit. Leave empty and no reward copy appears. */
reward?: string
/** Optional reward terms, shown in small print beside the share card. */
rewardTerms?: React.ReactNode
/** Practice or business name used in the letter, the path and the note. */
practice?: string
/** First name for the salutation; without it the letter opens Dear friend. */
patientName?: string
/** Tooth-care illustration (slot: product), transparent background. */
illustrationImage?: string
illustrationAlt?: string
/** Tab selected on first render. */
defaultChannel?: ReferralShare6Channel
copy?: Partial<Omit<ReferralShare6Copy, 'tabs' | 'actions' | 'hints'>> & {
tabs?: Partial<Record<ReferralShare6Channel, string>>
actions?: Partial<Record<ReferralShare6Channel, string>>
hints?: Partial<Record<ReferralShare6Channel, string>>
}
/** Called when the visitor sends or copies, with the full message (note + link), before their app opens. */
onAction?: (channel: ReferralShare6Channel, message: string) => void
/** Called after the note and link are copied. */
onCopy?: (message: string) => void
disabled?: boolean
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error' | 'success'
className?: string
}
const CHANNELS: ReferralShare6Channel[] = ['text', 'email', 'copy']
const TAB_ICONS = { text: MessageSquareText, email: Mail, copy: Link2 }
const NL = String.fromCharCode(10)
export function ReferralShare6(props: ReferralShare6Props) {
const {
link,
reward,
rewardTerms,
practice = 'our practice',
patientName,
illustrationImage,
illustrationAlt = '',
defaultChannel = 'text',
onAction,
onCopy,
state = 'default',
className,
} = props
const custom = props.copy || {}
const copy: ReferralShare6Copy = {
...DEFAULT_COPY,
...custom,
tabs: { ...DEFAULT_COPY.tabs, ...(custom.tabs || {}) },
actions: { ...DEFAULT_COPY.actions, ...(custom.actions || {}) },
hints: { ...DEFAULT_COPY.hints, ...(custom.hints || {}) },
}
const disabled = Boolean(props.disabled) || state === 'disabled'
const rewardText = reward ? reward.trim() : ''
const hasReward = rewardText !== ''
const vars = { practice, reward: rewardText, name: patientName ? patientName.trim() : '' }
const uid = React.useId().replace(/:/g, '')
const headId = 'rs6' + uid + '-head'
const noteId = 'rs6' + uid + '-note'
const errId = 'rs6' + uid + '-err'
const panelId = 'rs6' + uid + '-panel'
const tabId = (c: ReferralShare6Channel) => 'rs6' + uid + '-tab-' + c
const [channel, setChannel] = React.useState<ReferralShare6Channel>(state === 'success' ? 'copy' : defaultChannel)
const [draft, setDraft] = React.useState<string | null>(state === 'error' ? '' : null)
const [touched, setTouched] = React.useState(state === 'error')
const [copyStatus, setCopyStatus] = React.useState<'idle' | 'copied' | 'error'>('idle')
// static = finished look (no JS, reduced motion); armed waits offscreen; in plays once.
const [motion, setMotion] = React.useState<'static' | 'armed' | 'in'>('static')
const pathRef = React.useRef<HTMLOListElement>(null)
const noteRef = React.useRef<HTMLTextAreaElement>(null)
const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])
const timer = React.useRef<number | null>(null)
React.useEffect(() => {
if (state === 'error') {
setDraft('')
setTouched(true)
} else {
setDraft(null)
setTouched(false)
}
setChannel(state === 'success' ? 'copy' : defaultChannel)
setCopyStatus('idle')
}, [state, defaultChannel])
React.useEffect(() => {
return () => {
if (timer.current !== null) window.clearTimeout(timer.current)
}
}, [])
useIsoLayoutEffect(() => {
const el = pathRef.current
if (!el || typeof IntersectionObserver === 'undefined') return
if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
setMotion('armed')
const io = new IntersectionObserver(
(entries) => {
if (entries.some((e) => e.isIntersecting)) {
setMotion('in')
io.disconnect()
}
},
{ threshold: 0.3 },
)
io.observe(el)
return () => io.disconnect()
}, [])
const template = fill(hasReward ? copy.messageWithReward : copy.message, vars)
const note = draft === null ? template : draft
const noteText = note.trim()
const invalid = noteText === ''
const full = invalid ? link : noteText + NL + link
const subject = fill(copy.subject, vars)
const showNoteError = !disabled && (state === 'error' || (touched && invalid))
const shownCopy = disabled ? 'idle' : state === 'success' ? 'copied' : copyStatus
const forced = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : ''
function select(next: ReferralShare6Channel) {
setChannel(next)
setCopyStatus('idle')
}
function onTabKey(e: React.KeyboardEvent<HTMLButtonElement>, i: number) {
let n = -1
if (e.key === 'ArrowRight') n = (i + 1) % CHANNELS.length
else if (e.key === 'ArrowLeft') n = (i + CHANNELS.length - 1) % CHANNELS.length
else if (e.key === 'Home') n = 0
else if (e.key === 'End') n = CHANNELS.length - 1
if (n < 0) return
e.preventDefault()
select(CHANNELS[n])
const target = tabRefs.current[n]
if (target) target.focus()
}
function blockIfInvalid(): boolean {
if (!invalid) return false
setTouched(true)
if (noteRef.current) noteRef.current.focus()
return true
}
function handleSend(e: React.MouseEvent<HTMLAnchorElement>) {
if (disabled || blockIfInvalid()) {
e.preventDefault()
return
}
if (onAction) onAction(channel, full)
}
async function handleCopy() {
if (disabled || blockIfInvalid()) return
let ok = false
try {
if (typeof navigator !== 'undefined' && navigator.clipboard && window.isSecureContext) {
await navigator.clipboard.writeText(full)
ok = true
}
} catch {
ok = false
}
if (!ok) ok = legacyCopy(full)
if (timer.current !== null) window.clearTimeout(timer.current)
if (ok) {
setCopyStatus('copied')
if (onCopy) onCopy(full)
if (onAction) onAction('copy', full)
timer.current = window.setTimeout(() => setCopyStatus('idle'), 2400)
} else {
setCopyStatus('error')
}
}
const stops = [
{ Icon: Send, title: copy.shareTitle, detail: fill(copy.shareDetail, vars) },
{ Icon: CalendarCheck, title: copy.bookTitle, detail: fill(copy.bookDetail, vars) },
hasReward
? { Icon: Gift, title: fill(copy.rewardTitle, vars), detail: copy.rewardDetail }
: { Icon: HeartHandshake, title: copy.careTitle, detail: copy.careDetail },
]
const btnClass = 'rs6-btn' + forced
let actionEl: React.ReactNode
if (channel === 'copy') {
actionEl = (
<button
type='button'
className={btnClass + (shownCopy === 'copied' ? ' is-copied' : '')}
onClick={() => {
void handleCopy()
}}
disabled={disabled}
>
{shownCopy === 'copied' ? (
<>
<Check size={20} strokeWidth={2.5} aria-hidden='true' />
{copy.copiedLabel}
</>
) : (
copy.actions.copy
)}
</button>
)
} else if (disabled) {
actionEl = (
<button type='button' className={btnClass} disabled>
{copy.actions[channel]}
</button>
)
} else {
const href =
channel === 'text'
? 'sms:?&body=' + encodeURIComponent(full)
: 'mailto:?subject=' + encodeURIComponent(subject) + '&body=' + encodeURIComponent(full)
actionEl = (
<a className={btnClass} href={href} onClick={handleSend}>
{copy.actions[channel]}
</a>
)
}
const copyFailed = channel === 'copy' && shownCopy === 'error'
const HintIcon = copyFailed ? CircleAlert : channel === 'copy' ? Copy : Lock
return (
<section
className={'cf-referral-share-6' + (className ? ' ' + className : '')}
data-motion={motion}
aria-labelledby={headId}
>
<style>{CSS}</style>
<div className='rs6-top'>
<div className={'rs6-wrap rs6-intro' + (illustrationImage ? ' has-art' : '')}>
<div className='rs6-letter'>
<p className='rs6-salute'>{vars.name ? fill(copy.salutation, vars) : copy.salutationAnon}</p>
<h2 id={headId} className='rs6-h2'>
{copy.headlineStart}
<span className='rs6-mark'>{copy.headlineMark}</span>
{copy.headlineEnd}
</h2>
<div className='rs6-body'>
{copy.paragraphs.map((p, i) => (
<p key={i}>{fill(p, vars)}</p>
))}
</div>
<p className='rs6-sign'>
<span>{copy.signOff}</span>
<strong>{fill(copy.signer, vars)}</strong>
</p>
</div>
{illustrationImage ? (
<figure className='rs6-art'>
<img src={illustrationImage} alt={illustrationAlt} width={480} height={480} loading='lazy' decoding='async' />
</figure>
) : null}
</div>
<ol ref={pathRef} className='rs6-wrap rs6-path' aria-label={copy.pathLabel}>
{stops.map((s, i) => {
const Icon = s.Icon
return (
<li
key={i}
className={'rs6-stop' + (i === stops.length - 1 ? ' is-goal' : '')}
style={{ '--i': i } as React.CSSProperties}
>
<span className='rs6-node' aria-hidden='true'>
<Icon size={24} strokeWidth={2.5} />
</span>
<div className='rs6-stop-text'>
<h3 className='rs6-h3'>
<span className='rs6-num'>{i + 1}</span>
{s.title}
</h3>
<p>{s.detail}</p>
</div>
</li>
)
})}
</ol>
</div>
<div className='rs6-send'>
<div className='rs6-wrap rs6-send-grid'>
<div className='rs6-send-intro'>
<h3 className='rs6-send-h'>{copy.sendHeadline}</h3>
<p className='rs6-send-lead'>{copy.sendLead}</p>
<p className='rs6-linkline'>
<span className='rs6-linklabel'>{copy.linkLabel}</span>
<span className='rs6-linkchip'>{link}</span>
</p>
{rewardTerms ? <p className='rs6-terms'>{rewardTerms}</p> : null}
</div>
<div className='rs6-card'>
<div className='rs6-tabs' role='tablist' aria-label={copy.tabsLabel}>
{CHANNELS.map((c, i) => {
const TabIcon = TAB_ICONS[c]
const selected = c === channel
return (
<button
key={c}
ref={(el) => {
tabRefs.current[i] = el
}}
type='button'
role='tab'
id={tabId(c)}
className='rs6-tab'
aria-selected={selected}
aria-controls={panelId}
tabIndex={selected ? 0 : -1}
disabled={disabled}
onClick={() => select(c)}
onKeyDown={(e) => onTabKey(e, i)}
>
<TabIcon size={18} strokeWidth={2.5} aria-hidden='true' />
{copy.tabs[c]}
</button>
)
})}
</div>
<div className='rs6-panel' role='tabpanel' id={panelId} aria-labelledby={tabId(channel)}>
<div className='rs6-editor'>
<label htmlFor={noteId} className='rs6-label'>
{copy.noteLabel}
</label>
<textarea
ref={noteRef}
id={noteId}
className='rs6-field'
rows={5}
value={note}
placeholder={copy.notePlaceholder}
disabled={disabled}
aria-invalid={showNoteError || undefined}
aria-describedby={showNoteError ? errId : undefined}
onChange={(e) => {
setDraft(e.target.value)
setTouched(true)
}}
onBlur={() => setTouched(true)}
/>
{showNoteError ? (
<p id={errId} className='rs6-error'>
<CircleAlert size={16} strokeWidth={2.5} aria-hidden='true' className='rs6-inline-icon' />
{copy.noteError}
</p>
) : null}
<p className='rs6-added'>
{copy.linkAdded} <strong>{link}</strong>
</p>
</div>
<div className='rs6-preview'>
<p className='rs6-preview-label'>{copy.previewLabel}</p>
<div key={channel} className='rs6-swap'>
{channel === 'text' ? (
<>
<p className='rs6-meta'>{copy.toLine}</p>
<div className='rs6-bubble is-sent'>
{noteText ? <span className='rs6-bubble-text'>{noteText}</span> : null}
<span className={'rs6-bubble-link' + (noteText ? '' : ' is-alone')}>{link}</span>
</div>
</>
) : channel === 'email' ? (
<div className='rs6-mail'>
<p className='rs6-mail-row'>{copy.fromLine}</p>
<p className='rs6-mail-row is-subject'>
<span>{copy.subjectLabel}</span> <strong>{subject}</strong>
</p>
{noteText ? <p className='rs6-mail-body'>{noteText}</p> : null}
<p className='rs6-mail-link'>{link}</p>
</div>
) : (
<>
<p className='rs6-meta'>{copy.pastedLine}</p>
<div className='rs6-bubble is-pasted'>
{noteText ? <span className='rs6-bubble-text'>{noteText}</span> : null}
<span className={'rs6-bubble-link' + (noteText ? '' : ' is-alone')}>{link}</span>
<span className='rs6-unfurl'>
<strong>{practice}</strong>
<span>{hostOf(link)}</span>
</span>
</div>
</>
)}
</div>
</div>
<div className='rs6-action'>
{actionEl}
<p className={'rs6-hint' + (copyFailed ? ' is-error' : '')}>
<HintIcon size={16} strokeWidth={2.5} aria-hidden='true' className='rs6-inline-icon' />
{copyFailed ? copy.copyError : copy.hints[channel]}
</p>
<p className='rs6-sr' role='status' aria-live='polite'>
{shownCopy === 'copied' ? copy.copiedAnnounce : ''}
</p>
</div>
</div>
</div>
</div>
</div>
</section>
)
}
export default ReferralShare6
const DEFAULT_COPY: ReferralShare6Copy = {
salutation: 'Dear {name},',
salutationAnon: 'Dear friend,',
headlineStart: 'Know someone who keeps ',
headlineMark: 'putting off the dentist',
headlineEnd: '?',
paragraphs: [
'Thank you for taking a minute to review {practice}. It truly helps a local practice like ours.',
'If a friend, partner or co-worker has been meaning to book a check-up, a quick note from you is the easiest nudge. We’ve written it below. Send it as is, or make it yours.',
],
signOff: 'Warmly,',
signer: 'The team at {practice}',
pathLabel: 'How a referral works',
shareTitle: 'Share your link',
shareDetail: 'Send our ready-made note by text or email, or copy it anywhere.',
bookTitle: 'Your friend books',
bookDetail: 'They tap your link and choose a time for their first visit with {practice}.',
rewardTitle: 'You both get {reward}',
rewardDetail: 'Our thank-you for sending someone you care about our way.',
careTitle: 'Your friend gets the same care',
careDetail: 'The same team and the same care you’ve had from us.',
sendHeadline: 'Send it the way you’d message a friend',
sendLead: 'Your note is written and your link is already in it. Pick text, email or copy, then send.',
linkLabel: 'Your personal link',
tabsLabel: 'Choose how to send it',
tabs: { text: 'Text', email: 'Email', copy: 'Copy link' },
noteLabel: 'Your note',
notePlaceholder: 'Hi! I thought of you. If you’ve been meaning to book a check-up, here’s my link.',
noteError: 'Write a short note so your friend knows it’s from you.',
linkAdded: 'Your link is added at the end:',
actions: { text: 'Send it by text', email: 'Send it by email', copy: 'Copy note + link' },
copiedLabel: 'Copied',
copiedAnnounce: 'Your note and link are copied. Paste them anywhere.',
copyError: 'Couldn’t copy here. Select your note and link and copy them by hand.',
hints: {
text: 'Opens your messages app. Nothing sends until you tap send.',
email: 'Opens your email with the note ready. You choose who gets it.',
copy: 'Paste it into any chat, post or group text.',
},
previewLabel: 'What your friend sees',
toLine: 'To: your friend',
fromLine: 'From: you',
subjectLabel: 'Subject:',
subject: 'Thought of you: {practice}',
pastedLine: 'Pasted into any chat',
message:
'Hi! I’ve been going to {practice} and thought of you. If you’ve been meaning to book a check-up, here’s my link:',
messageWithReward: 'Hi! I’ve been going to {practice} and thought of you. Book with my link and we both get {reward}:',
}
const useIsoLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect
function fill(template: string, vars: Record<string, string>): string {
return Object.keys(vars).reduce((out, key) => out.split('{' + key + '}').join(vars[key]), template)
}
function hostOf(url: string): string {
try {
return new URL(url).hostname.replace(/^www[.]/, '')
} catch {
return url
}
}
function legacyCopy(text: string): boolean {
if (typeof document === 'undefined' || !document.body) return false
const area = document.createElement('textarea')
area.value = text
area.setAttribute('readonly', '')
area.style.position = 'fixed'
area.style.top = '0'
area.style.left = '0'
area.style.opacity = '0'
document.body.appendChild(area)
area.select()
let ok = false
try {
ok = document.execCommand('copy')
} catch {
ok = false
}
document.body.removeChild(area)
return ok
}
const CSS = `
.cf-referral-share-6 {
--rs6-gutter: clamp(16px, 5vw, 48px);
--rs6-cut: clamp(44px, 7vw, 104px);
--rs6-shadow: var(--shadow, oklch(0.22 0.03 260));
position: relative;
overflow: hidden;
background: var(--surface);
color: var(--ink);
font-family: var(--font-body);
}
.cf-referral-share-6 *, .cf-referral-share-6 *::before, .cf-referral-share-6 *::after { box-sizing: border-box; }
.cf-referral-share-6 .rs6-wrap { max-width: 1120px; margin-inline: auto; }
.cf-referral-share-6 .rs6-top { padding: clamp(56px, 8vw, 112px) var(--rs6-gutter) clamp(48px, 6vw, 80px); }
.cf-referral-share-6 .rs6-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (min-width: 900px) {
.cf-referral-share-6 .rs6-intro.has-art { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
.cf-referral-share-6 .rs6-salute { margin: 0 0 16px; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 600; color: var(--ink); }
.cf-referral-share-6 .rs6-h2 {
margin: 0 0 20px;
font-family: var(--font-display);
font-size: clamp(2rem, 3.6vw, 3.25rem);
line-height: 1.06;
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.025em);
text-transform: var(--display-case, none);
text-wrap: balance;
color: var(--ink);
}
.cf-referral-share-6 .rs6-mark {
padding: 0 0.06em;
background-image: linear-gradient(transparent 55%, color-mix(in oklch, var(--marker, #fae37c) 62%, var(--surface)) 55%, color-mix(in oklch, var(--marker, #fae37c) 62%, var(--surface)) 92%, transparent 92%);
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.cf-referral-share-6 .rs6-body p { margin: 0 0 14px; max-width: 62ch; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.cf-referral-share-6 .rs6-body p:last-child { margin-bottom: 0; }
.cf-referral-share-6 .rs6-sign { margin: 24px 0 0; display: flex; flex-direction: column; gap: 2px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--ink); }
.cf-referral-share-6 .rs6-sign strong { font-weight: 700; }
.cf-referral-share-6 .rs6-art { margin: 0; display: flex; justify-content: center; }
.cf-referral-share-6 .rs6-art img {
display: block;
width: 100%;
max-width: 440px;
height: auto;
aspect-ratio: 1 / 1;
object-fit: contain;
border-radius: 0;
filter: drop-shadow(0 2px 3px oklch(from var(--rs6-shadow) l c h / 0.22)) drop-shadow(0 16px 20px oklch(from var(--rs6-shadow) l c h / 0.16));
}
@media (max-width: 899px) {
.cf-referral-share-6 .rs6-art img { max-width: 240px; }
}
.cf-referral-share-6 .rs6-path { list-style: none; padding: 0; margin: clamp(48px, 6vw, 80px) auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cf-referral-share-6 .rs6-stop { position: relative; padding: 0 clamp(12px, 2vw, 28px); text-align: center; }
.cf-referral-share-6 .rs6-stop:not(:last-child)::before,
.cf-referral-share-6 .rs6-stop:not(:last-child)::after {
content: '';
position: absolute;
top: 27px;
left: calc(50% + 40px);
width: calc(100% - 80px);
height: 3px;
border-radius: 3px;
}
.cf-referral-share-6 .rs6-stop:not(:last-child)::before { background: oklch(from var(--ink) l c h / 0.14); }
.cf-referral-share-6 .rs6-stop:not(:last-child)::after { background: var(--accent-fill, var(--accent)); transform-origin: left center; }
.cf-referral-share-6 .rs6-node {
position: relative;
z-index: 1;
display: inline-grid;
place-items: center;
width: 56px;
height: 56px;
border-radius: 999px;
background: var(--accent-fill, var(--accent));
color: var(--accent-fill-ink, var(--card));
box-shadow: inset 0 1px 0 oklch(from var(--accent-fill, var(--accent)) calc(l + 0.12) c h / 0.6), 0 1px 2px oklch(from var(--rs6-shadow) l c h / 0.25), 0 6px 12px -4px oklch(from var(--rs6-shadow) l c h / 0.3);
}
.cf-referral-share-6 .rs6-stop.is-goal .rs6-node { outline: 3px solid oklch(from var(--accent-fill, var(--accent)) l c h / 0.28); outline-offset: 4px; }
.cf-referral-share-6 .rs6-h3 {
margin: 20px 0 8px;
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);
}
.cf-referral-share-6 .rs6-num { margin-inline-end: 0.35em; color: var(--accent); font-variant-numeric: tabular-nums; }
.cf-referral-share-6 .rs6-stop-text p { margin: 0 auto; max-width: 30ch; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
@media (max-width: 640px) {
.cf-referral-share-6 .rs6-path { grid-template-columns: minmax(0, 1fr); }
.cf-referral-share-6 .rs6-stop { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 16px; padding: 0 0 28px; text-align: left; }
.cf-referral-share-6 .rs6-stop:last-child { padding-bottom: 0; }
.cf-referral-share-6 .rs6-stop:not(:last-child)::before,
.cf-referral-share-6 .rs6-stop:not(:last-child)::after { top: 64px; bottom: 8px; left: 26.5px; width: 3px; height: auto; }
.cf-referral-share-6 .rs6-stop:not(:last-child)::after { transform-origin: center top; }
.cf-referral-share-6 .rs6-h3 { margin-top: 14px; }
.cf-referral-share-6 .rs6-stop-text p { margin: 0; max-width: none; }
}
.cf-referral-share-6[data-motion=armed] .rs6-stop { opacity: 0.82; transform: translateY(8px); }
.cf-referral-share-6[data-motion=armed] .rs6-stop::after { transform: scaleX(0); }
.cf-referral-share-6[data-motion=in] .rs6-stop { animation: rs6-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 0.07s); }
.cf-referral-share-6[data-motion=in] .rs6-stop::after { animation: rs6-draw-x 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.2s + var(--i, 0) * 0.25s); }
@media (max-width: 640px) {
.cf-referral-share-6[data-motion=armed] .rs6-stop::after { transform: scaleY(0); }
.cf-referral-share-6[data-motion=in] .rs6-stop::after { animation-name: rs6-draw-y; }
}
@keyframes rs6-rise { from { opacity: 0.82; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rs6-draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rs6-draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.cf-referral-share-6 .rs6-send {
position: relative;
background: var(--band);
color: var(--band-ink);
padding: calc(var(--rs6-cut) + clamp(40px, 5vw, 72px)) var(--rs6-gutter) clamp(64px, 8.5vw, 120px);
clip-path: polygon(0 var(--rs6-cut), 100% 0, 100% 100%, 0 100%);
}
.cf-referral-share-6 .rs6-send-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (min-width: 1100px) {
.cf-referral-share-6 .rs6-send-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); }
}
.cf-referral-share-6 .rs6-send-h {
margin: 0 0 12px;
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(--band-ink);
}
.cf-referral-share-6 .rs6-send-lead { margin: 0 0 24px; max-width: 46ch; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--band-ink); text-wrap: pretty; }
.cf-referral-share-6 .rs6-linkline { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--band-ink); }
.cf-referral-share-6 .rs6-linklabel { font-size: 0.9375rem; font-weight: 700; line-height: 1.4; }
.cf-referral-share-6 .rs6-linkchip { display: inline-block; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: oklch(from var(--band-ink) l c h / 0.12); color: var(--band-ink); font-size: 0.9375rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.cf-referral-share-6 .rs6-terms { margin: 16px 0 0; font-size: 0.9375rem; line-height: 1.4; color: var(--band-ink); text-wrap: pretty; }
.cf-referral-share-6 .rs6-card {
container-type: inline-size;
min-width: 0;
padding: clamp(20px, 3vw, 32px);
background: var(--card);
color: var(--ink);
border: 1px solid var(--card-border, oklch(from var(--ink) l c h / 0.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 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 260 / 0.32)));
}
.cf-referral-share-6 .rs6-tabs { display: flex; gap: 4px; padding: 4px; border-radius: calc(var(--radius, 12px) + 4px); background: color-mix(in oklch, var(--ink) 6%, var(--card)); }
.cf-referral-share-6 .rs6-tab {
flex: 1 1 0;
min-width: 0;
min-height: 48px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 0 12px;
border: 0;
border-radius: var(--radius, 12px);
background: transparent;
color: var(--ink);
font-family: var(--font-body);
font-size: 1rem;
font-weight: 700;
line-height: 1.2;
white-space: nowrap;
cursor: pointer;
transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.cf-referral-share-6 .rs6-tab svg { flex: none; color: var(--muted); }
.cf-referral-share-6 .rs6-tab:hover:not(:disabled):not([aria-selected=true]) { background: color-mix(in oklch, var(--ink) 11%, var(--card)); }
.cf-referral-share-6 .rs6-tab:active:not(:disabled) { transform: translateY(1px); }
.cf-referral-share-6 .rs6-tab[aria-selected=true] { background: var(--card); font-weight: 800; box-shadow: var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)); }
.cf-referral-share-6 .rs6-tab[aria-selected=true] svg { color: var(--accent); }
.cf-referral-share-6 .rs6-tab:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.55); outline-offset: 2px; }
.cf-referral-share-6 .rs6-tab:disabled { cursor: not-allowed; color: var(--muted); }
@container (max-width: 400px) {
.cf-referral-share-6 .rs6-tab svg { display: none; }
.cf-referral-share-6 .rs6-tab { padding: 0 8px; }
}
.cf-referral-share-6 .rs6-panel { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'editor' 'preview' 'action'; gap: 24px; align-items: start; }
@container (min-width: 600px) {
.cf-referral-share-6 .rs6-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'editor preview' 'action preview'; }
}
.cf-referral-share-6 .rs6-editor { grid-area: editor; min-width: 0; }
.cf-referral-share-6 .rs6-preview { grid-area: preview; min-width: 0; }
.cf-referral-share-6 .rs6-action { grid-area: action; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cf-referral-share-6 .rs6-label { display: block; margin: 0 0 8px; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; color: var(--label-ink, var(--ink)); }
.cf-referral-share-6 .rs6-field {
display: block;
width: 100%;
min-height: 156px;
padding: 14px 16px;
font-family: var(--font-body);
font-size: 1.0625rem;
line-height: 1.45;
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));
box-shadow: inset 0 1px 2px oklch(from var(--rs6-shadow) l c h / 0.08);
resize: vertical;
transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cf-referral-share-6 .rs6-field::placeholder { color: color-mix(in oklch, var(--field-ink) 65%, var(--field)); opacity: 1; }
.cf-referral-share-6 .rs6-field:hover:not(:disabled) { border-color: color-mix(in oklch, var(--ink) 38%, transparent); }
.cf-referral-share-6 .rs6-field:focus { outline: none; border-color: var(--field-focus, var(--accent)); box-shadow: 0 0 0 3px oklch(from var(--field-focus, var(--accent)) l c h / 0.35); }
.cf-referral-share-6 .rs6-field[aria-invalid=true] { border-color: var(--danger); }
.cf-referral-share-6 .rs6-field[aria-invalid=true]:focus { box-shadow: 0 0 0 3px oklch(from var(--danger) l c h / 0.3); }
.cf-referral-share-6 .rs6-field:disabled { cursor: not-allowed; color: var(--muted); background: color-mix(in oklch, var(--ink) 4%, var(--field)); }
.cf-referral-share-6 .rs6-error { margin: 8px 0 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--danger); text-wrap: pretty; }
.cf-referral-share-6 .rs6-inline-icon { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-referral-share-6 .rs6-added { margin: 12px 0 0; font-size: 0.9375rem; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.cf-referral-share-6 .rs6-added strong { font-weight: 700; color: var(--ink); }
.cf-referral-share-6 .rs6-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
min-height: 56px;
padding: 0 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
font-family: var(--button-font, var(--font-display));
font-size: clamp(1.125rem, 1.55vw, 1.375rem);
font-weight: var(--button-weight, 800);
line-height: 1.15;
text-transform: var(--button-case, none);
text-decoration: none;
white-space: nowrap;
color: var(--button-ink, var(--cta-ink));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--rs6-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--rs6-shadow) l c h / 0.4));
cursor: pointer;
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-referral-share-6 .rs6-btn:hover:not(:disabled),
.cf-referral-share-6 .rs6-btn.is-hover:not(:disabled) {
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h));
box-shadow: inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.6), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--rs6-shadow) l c h / 0.32), 0 10px 18px -6px oklch(from var(--rs6-shadow) l c h / 0.5);
transform: translateY(-1px);
}
.cf-referral-share-6 .rs6-btn:active:not(:disabled),
.cf-referral-share-6 .rs6-btn.is-active:not(:disabled) {
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.05) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--rs6-shadow) l c h / 0.3);
transform: translateY(1px);
}
.cf-referral-share-6 .rs6-btn:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.55); outline-offset: 3px; }
.cf-referral-share-6 .rs6-btn: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));
transform: none;
}
.cf-referral-share-6 .rs6-btn svg { flex: none; }
.cf-referral-share-6 .rs6-hint { margin: 0; font-size: 0.9375rem; font-weight: 500; line-height: 1.4; color: var(--muted); text-align: center; text-wrap: pretty; }
.cf-referral-share-6 .rs6-hint.is-error { color: var(--danger); font-weight: 600; }
.cf-referral-share-6 .rs6-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cf-referral-share-6 .rs6-preview { display: flex; flex-direction: column; gap: 12px; padding: clamp(16px, 2.4vw, 24px); border-radius: 10px; background: color-mix(in oklch, var(--ink) 4%, var(--card)); }
.cf-referral-share-6 .rs6-preview-label { margin: 0; font-size: 0.9375rem; font-weight: 700; line-height: 1.4; color: var(--ink); }
.cf-referral-share-6 .rs6-swap { display: flex; flex-direction: column; gap: 10px; }
.cf-referral-share-6 .rs6-meta { margin: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--muted); }
.cf-referral-share-6 .rs6-bubble { max-width: 92%; padding: 12px 16px; font-size: 1rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-referral-share-6 .rs6-bubble.is-sent { align-self: flex-end; border-radius: 20px 20px 6px 20px; background: var(--accent-fill, var(--accent)); color: var(--accent-fill-ink, var(--card)); }
.cf-referral-share-6 .rs6-bubble.is-pasted { align-self: flex-start; border-radius: 20px 20px 20px 6px; background: color-mix(in oklch, var(--ink) 10%, var(--card)); color: var(--ink); }
.cf-referral-share-6 .rs6-bubble-text { display: block; }
.cf-referral-share-6 .rs6-bubble-link { display: block; margin-top: 6px; font-weight: 700; text-decoration: underline; text-underline-offset: 0.18em; }
.cf-referral-share-6 .rs6-bubble-link.is-alone { margin-top: 0; }
.cf-referral-share-6 .rs6-unfurl { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid oklch(from var(--ink) l c h / 0.14); white-space: normal; }
.cf-referral-share-6 .rs6-unfurl strong { font-size: 0.9375rem; font-weight: 800; }
.cf-referral-share-6 .rs6-unfurl span { font-size: 0.9375rem; color: var(--muted); }
.cf-referral-share-6 .rs6-mail { display: flex; flex-direction: column; gap: 10px; }
.cf-referral-share-6 .rs6-mail-row { margin: 0; padding-bottom: 10px; border-bottom: 1px solid oklch(from var(--ink) l c h / 0.14); font-size: 0.9375rem; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.cf-referral-share-6 .rs6-mail-row.is-subject strong { color: var(--ink); font-weight: 700; }
.cf-referral-share-6 .rs6-mail-body { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-referral-share-6 .rs6-mail-link {
margin: 0;
font-size: 1rem;
font-weight: 600;
color: var(--link, var(--accent));
text-decoration: underline;
text-decoration-color: oklch(from var(--link, var(--accent)) l c h / 0.45);
text-underline-offset: 0.18em;
overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: no-preference) {
.cf-referral-share-6 .rs6-swap { animation: rs6-rise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
.cf-referral-share-6 *, .cf-referral-share-6 *::before, .cf-referral-share-6 *::after { animation: none !important; transition: none !important; }
}
`
pieces/checkout/referral-share-6/specimen.tsx 24 lines
import __studioImage83acd23e from "../assets/3e981b108545bdc1.webp";
// Specimen: Bright Harbor Dental’s review thank-you, with a supplied referral reward.
import * as React from 'react'
import { ReferralShare6, type ReferralShare6Props } from '../referral-share-6'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error', 'success']
export default function ReferralShare6Specimen({ state = 'default' }: { state?: ReferralShare6Props['state'] }) {
return (
<ReferralShare6
practice='Bright Harbor Dental'
patientName='Sam'
link='https://brightharbor.dental/r/sam-24'
reward='a $25 credit'
illustrationImage={slot(
'product',
__studioImage83acd23e,
)}
illustrationAlt='A gleaming white tooth beside a toothbrush and dental floss'
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
link RequiredReferralShare6 |
string |
|
reward OptionalReferralShare6 |
string |
|
rewardTerms OptionalReferralShare6 |
React.ReactNode |
|
practice OptionalReferralShare6 |
string |
|
patientName OptionalReferralShare6 |
string |
|
illustrationImage OptionalReferralShare6 |
string |
|
illustrationAlt OptionalReferralShare6 |
string |
|
defaultChannel OptionalReferralShare6 |
ReferralShare6Channel |
|
copy OptionalReferralShare6 |
Partial<Omit<ReferralShare6Copy, 'tabs' | 'actions' | 'hints'>> & {
tabs?: Partial<Record<ReferralShare6Channel, string>>
actions?: Partial<Record<ReferralShare6Channel, string>>
hints?: Partial<Record<ReferralShare6Channel, string>>
} |
|
onAction OptionalReferralShare6 |
(channel: ReferralShare6Channel, message: string) => void |
|
onCopy OptionalReferralShare6 |
(message: string) => void |
|
disabled OptionalReferralShare6 |
boolean |
|
state OptionalReferralShare6 |
'default' | 'hover' | 'active' | 'disabled' | 'error' | 'success' |
|
className OptionalReferralShare6 |
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--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.
product- The main product shot or cover (ebook, kit, bottle).
-
3e981b108545bdc1.webp
image/webp · 125 KB