Commitment Pledge 6
Gets the registrant to tick and sign a pledge to attend every day, shown as a step in their signup.
Use it in a prompt
Use forms/commitment-pledge-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/forms/commitment-pledge-6.tsx. - Import it and pass your copy and images (Props tab):
import { CommitmentPledge6 } from "@/components/funneldna/forms/commitment-pledge-6"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/commitment-pledge-6/component.tsx 498 lines
// Gets the registrant to tick and sign a pledge to attend every day, shown as a step in their signup.
'use client'
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, PenLine } from 'lucide-react'
export type CommitmentPledge6Props = {
/** Templates accept {dayCount}, {eventName}, {current}, {total}, {percent} and {date} as text. */
copy?: Partial<typeof defaultCopy>
/** Validated pledge; takes precedence over onCommit. A returned promise shows the loading label. */
onSubmit?: (pledge: { name: string }) => void | Promise<void>
/** @deprecated No longer rendered: the builder wires what happens after submit. */
href?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
onAction?: () => void
/** seal-guarantee slot; takes precedence over sealImage. */
sealGuaranteeImage?: string
/** Event or challenge name, shown under the pledge line. */
eventName?: string
/** Number of days the registrant pledges to attend. Drives the copy. */
dayCount?: number
/** Funnel steps shown in the progress tabs. */
steps?: string[]
/** Index of this pledge step inside `steps`. */
currentStep?: number
headline?: React.ReactNode
lead?: string
legend?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
signedLegend?: string
pledge?: string
pledgeDetail?: string
nameLabel?: string
namePlaceholder?: string
label?: string
loadingLabel?: string
reassurance?: string
backLabel?: string
idleNote?: string
errorNote?: string
checkErrorText?: string
nameErrorText?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
successMessage?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
successNote?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
joinLabel?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
joinHref?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
calendarLabel?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
calendarHref?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
editLabel?: string
disabledNote?: string
/** Generated seal image (transparent or plain white background). */
sealImage?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
sealAlt?: string
sealCaption?: string
/** @deprecated No longer rendered: the builder wires what happens after submit. */
sealCaptionDone?: string
defaultName?: string
disabled?: boolean
/** "success" is accepted for older callers and renders as default. */
state?: CommitmentPledgeDocumentState
onBack?: () => void
/** Legacy alias for onSubmit. */
onCommit?: (pledge: { name: string }) => void | Promise<void>
/** @deprecated No longer rendered: the builder wires what happens after submit. */
onJoin?: () => void
/** @deprecated No longer rendered: the builder wires what happens after submit. */
onAddToCalendar?: () => void
className?: string
style?: React.CSSProperties
}
export function CommitmentPledge6({
copy: copyOverrides,
onSubmit,
sealGuaranteeImage,
eventName,
dayCount = 5,
steps = ['Register', 'Commit', 'Join'],
currentStep = 1,
headline = (
<>
Make your <em>commitment.</em>
</>
),
lead = 'A clear plan starts with showing up.',
legend,
pledge,
pledgeDetail,
nameLabel = 'Sign with your full name',
namePlaceholder = 'Type your full name',
label = 'Sign My Pledge',
loadingLabel = 'Signing your pledge…',
reassurance = 'Takes 10 seconds. You can edit it later.',
backLabel = 'Back',
idleNote = 'Tick the pledge and sign your name to lock it in.',
errorNote = 'Almost there. Finish the step above to sign.',
checkErrorText = 'Tick the pledge to make it official.',
nameErrorText = 'Type your full name to sign your pledge.',
disabledNote = 'Your pledge opens as soon as your registration is confirmed.',
sealImage,
sealCaption = 'Your seal is pressed the moment you sign',
defaultName,
disabled = false,
state = 'default',
onBack,
onCommit,
className,
style,
}: CommitmentPledge6Props) {
const copy = { ...defaultCopy, ...copyOverrides }
const submitValue = onSubmit === undefined ? onCommit : onSubmit
const image = sealGuaranteeImage === undefined ? sealImage : sealGuaranteeImage
const uid = React.useId().replace(/:/g, '')
const isDisabled = disabled || state === 'disabled'
const [phase, setPhase] = React.useState<'idle' | 'loading'>('idle')
const [checked, setChecked] = React.useState(false)
const [name, setName] = React.useState(defaultName ?? '')
const [showErrors, setShowErrors] = React.useState(state === 'error')
const mounted = React.useRef(true)
const checkRef = React.useRef<HTMLInputElement>(null)
const nameRef = React.useRef<HTMLInputElement>(null)
React.useEffect(() => {
setPhase('idle')
setChecked(false)
setName(defaultName ?? '')
setShowErrors(state === 'error')
}, [state, defaultName])
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const trimmed = name.trim()
const loading = phase === 'loading'
const checkError = showErrors && !checked
const nameError = showErrors && trimmed.length < 2
const total = Math.max(steps.length, 1)
const activeIdx = Math.min(Math.max(currentStep, 0), total - 1)
const pct = Math.round(((activeIdx + 1) / total) * 100)
const legendText = legend ?? text(copy.legend, { dayCount })
const pledgeText = pledge ?? text(copy.pledge, { dayCount })
const detailText = pledgeDetail ?? (eventName ? text(copy.detail, { dayCount, eventName }) : undefined)
const statusKind = isDisabled ? 'disabled' : checkError || nameError ? 'error' : 'idle'
const btnClass = `cpd-btn${state === 'hover' ? ' is-hover' : ''}${state === 'active' ? ' is-active' : ''}`
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (isDisabled || loading) return
if (!checked || trimmed.length < 2) {
setShowErrors(true)
if (!checked) checkRef.current?.focus()
else nameRef.current?.focus()
return
}
setShowErrors(false)
const result = submitValue?.({ name: trimmed })
if (!result) return
setPhase('loading')
try {
await result
} catch {
// No failure UI in this piece; the caller reports errors.
} finally {
if (mounted.current) setPhase('idle')
}
}
return (
<div className={['cf-commitment-pledge-6 cpd', className].filter(Boolean).join(' ')} style={style}>
<link rel='stylesheet' href={SIGNATURE_FONT} />
<style>{CSS}</style>
<article className='cpd-doc' aria-labelledby={`${uid}-title`}>
<div className='cpd-meta'>
<span>
{text(copy.step, { current: activeIdx + 1, total })}
</span>
<span>{text(copy.complete, { percent: pct })}</span>
</div>
<div
className='cpd-bar'
role='progressbar'
aria-label={copy.progress}
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={pct}
style={{ '--pct': `${pct}%` } as React.CSSProperties}
>
<i />
</div>
<ol className='cpd-steps' aria-label={copy.steps} style={{ '--n': total } as React.CSSProperties}>
{steps.map((step, i) => {
const status = i < activeIdx ? 'done' : i === activeIdx ? 'now' : 'next'
return (
<li key={`${step}-${i}`} className={`cpd-step is-${status}`} aria-current={status === 'now' ? 'step' : undefined}>
<span className='cpd-step-n' aria-hidden='true'>
{status === 'done' ? <Check strokeWidth={3.25} /> : i + 1}
</span>
<span className='cpd-step-l'>{step}</span>
{status === 'done' ? <span className='cpd-sr'>{copy.completed}</span> : null}
</li>
)
})}
</ol>
<header className='cpd-head'>
<h2 id={`${uid}-title`} className='cpd-title'>
{headline}
</h2>
{lead ? <p className='cpd-lead'>{lead}</p> : null}
</header>
<form className='cpd-form' onSubmit={handleSubmit} noValidate aria-busy={loading || undefined}>
<fieldset className='cpd-pledge' disabled={isDisabled || loading}>
<legend className='cpd-legend'>{legendText}</legend>
<div className={`cpd-grid${image ? '' : ' no-seal'}`}>
<div className='cpd-main'>
<label className={`cpd-commit${checked ? ' is-on' : ''}${checkError ? ' is-invalid' : ''}`}>
<input
ref={checkRef}
type='checkbox'
className='cpd-sr'
name='pledge'
checked={checked}
onChange={(event) => setChecked(event.target.checked)}
aria-invalid={checkError || undefined}
aria-describedby={checkError ? `${uid}-ce` : undefined}
/>
<span className='cpd-box' aria-hidden='true'>
<Check strokeWidth={3.5} />
</span>
<span className='cpd-commit-copy'>
<span className='cpd-commit-text'>{pledgeText}</span>
{detailText ? <span className='cpd-commit-detail'>{detailText}</span> : null}
</span>
</label>
{checkError ? (
<p id={`${uid}-ce`} className='cpd-err'>
<AlertCircle aria-hidden='true' />
<span>{checkErrorText}</span>
</p>
) : null}
<div className='cpd-name'>
<label htmlFor={`${uid}-name`} className='cpd-name-label'>
{nameLabel}
</label>
<div className={`cpd-sigline${nameError ? ' is-invalid' : ''}`}>
<PenLine className='cpd-sigline-icon' aria-hidden='true' />
<input
ref={nameRef}
id={`${uid}-name`}
className='cpd-input'
type='text'
name='name'
autoComplete='name'
spellCheck={false}
placeholder={namePlaceholder}
value={name}
onChange={(event) => setName(event.target.value)}
aria-required='true'
aria-invalid={nameError || undefined}
aria-describedby={nameError ? `${uid}-ne` : undefined}
/>
</div>
{nameError ? (
<p id={`${uid}-ne`} className='cpd-err'>
<AlertCircle aria-hidden='true' />
<span>{nameErrorText}</span>
</p>
) : null}
</div>
</div>
{image ? (
<figure className='cpd-seal'>
<span className='cpd-seal-slot'>
<span className='cpd-seal-shadow' aria-hidden='true' />
<img src={image} alt='' width={320} height={320} decoding='async' />
</span>
<figcaption>{sealCaption}</figcaption>
</figure>
) : null}
</div>
</fieldset>
<div className='cpd-rule' aria-hidden='true' />
<div className={`cpd-status is-${statusKind}`} role='status' aria-live='polite'>
<p className='cpd-status-text'>
{statusKind === 'error' ? (
<AlertCircle className='cpd-status-icon' aria-hidden='true' />
) : statusKind === 'disabled' ? (
<Lock className='cpd-status-icon' aria-hidden='true' />
) : (
<PenLine className='cpd-status-icon' aria-hidden='true' />
)}
{statusKind === 'error' ? errorNote : statusKind === 'disabled' ? disabledNote : idleNote}
</p>
</div>
<div className='cpd-actions'>
<button type='button' className='cpd-btn2' onClick={onBack} disabled={isDisabled || loading}>
<span>{backLabel}</span>
</button>
<div className='cpd-go'>
<button type='submit' className={`${btnClass}${loading ? ' is-loading' : ''}`} disabled={isDisabled || loading}>
{loading ? (
<>
<Loader2 className='cpd-spin' aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<span>{label}</span>
)}
</button>
{reassurance ? <p className='cpd-note'>{reassurance}</p> : null}
</div>
</div>
</form>
</article>
</div>
)
}
/** "success" is accepted for older callers and renders as default. */
export type CommitmentPledgeDocumentState = 'default' | 'hover' | 'active' | 'disabled' | 'error' | 'success'
/* An autograph-style script so the typed name reads like ink on the pledge. */
const SIGNATURE_FONT = 'https://fonts.googleapis.com/css2?family=Mrs+Saint+Delafield&display=swap'
// Slotted seal artwork retains its original colours.
const CSS = `
.cf-commitment-pledge-6{display:block;width:100%;max-width:58rem;margin-inline:auto;color:var(--ink,#101828);font-family:var(--font-body,Georgia,serif);-webkit-font-smoothing:antialiased;--cpd-paper:var(--card);--cpd-paper-hi:var(--card);--cpd-rule:var(--card-border,oklch(from var(--ink) l c h / 0.22));--cpd-rule-soft:var(--card-border,oklch(from var(--ink) l c h / 0.12));--cpd-line:var(--field-border,oklch(from var(--ink) l c h / 0.22));--cpd-pen:var(--ink);--cpd-ok:var(--success);--cpd-err:var(--danger);}
.cf-commitment-pledge-6 input{accent-color:var(--field-focus,var(--accent))}
.cf-commitment-pledge-6 button{font:inherit;text-transform:var(--button-case,none)}
.cf-commitment-pledge-6 *,.cf-commitment-pledge-6 *::before,.cf-commitment-pledge-6 *::after{box-sizing:border-box}
.cf-commitment-pledge-6 :where(h2,p,ol,figure,fieldset,legend){margin:0}
.cf-commitment-pledge-6 :where(ol){padding:0;list-style:none}
:where(.cf-commitment-pledge-6) .cpd-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:normal;clip-path:inset(50%);}
:where(.cf-commitment-pledge-6) .cpd-doc{position:relative;isolation:isolate;background-color:var(--cpd-paper);border:1px solid var(--cpd-rule);padding:clamp(1.5rem,4.5vw,3rem) clamp(1.125rem,4.5vw,3.25rem) clamp(1.5rem,4vw,2.5rem);background:var(--card);border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius));box-shadow:var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-commitment-pledge-6) .cpd-doc::before{content:'';position:absolute;inset:.625rem;border:3px double var(--cpd-rule-soft);border-radius:.1875rem;pointer-events:none;z-index:-1}
:where(.cf-commitment-pledge-6) .cpd-doc::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:-1;background-image:none;}
:where(.cf-commitment-pledge-6) .cpd-meta{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;font-family:var(--font-display,Georgia,serif);font-weight:800;font-size:clamp(1rem,2.2vw,1.25rem);line-height:1.2;color:var(--ink,#101828)}
:where(.cf-commitment-pledge-6) .cpd-meta span:last-child{font-variant-numeric:tabular-nums}
:where(.cf-commitment-pledge-6) .cpd-bar{position:relative;margin-top:.75rem;height:.625rem;border-radius:999px;background:color-mix(in oklch,var(--ink,#101828) 14%,var(--cpd-paper));box-shadow:inset 0 1px 2px oklch(from var(--card) calc(l - 0.12) c h / 0.35);overflow:hidden}
:where(.cf-commitment-pledge-6) .cpd-bar i{position:absolute;inset:0 auto 0 0;width:var(--pct,0%);border-radius:inherit;background:var(--accent-fill,var(--accent,#0f5fc2));box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6),inset 0 -1px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35);transition:width .8s cubic-bezier(.2,.7,.2,1)}
:where(.cf-commitment-pledge-6) .cpd-steps{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:.25rem;margin:1.25rem auto 0;max-width:36rem;padding:.3125rem;background:var(--field,#fff);border:1.5px solid var(--cpd-line);border-radius:.75rem;box-shadow:var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2))}
:where(.cf-commitment-pledge-6) .cpd-step{display:flex;align-items:center;justify-content:center;gap:.5rem;min-width:0;min-height:2.75rem;padding:.375rem .625rem;border-radius:.5rem;font-family:var(--font-display,Georgia,serif);font-weight:700;font-size:1rem;line-height:1.1;white-space:nowrap;transition:background-color .35s ease,color .35s ease,box-shadow .35s ease;color:var(--field-ink);}
:where(.cf-commitment-pledge-6) .cpd-step-l{overflow:hidden;text-overflow:ellipsis}
:where(.cf-commitment-pledge-6) .cpd-step-n{display:grid;place-items:center;flex:none;width:1.5rem;height:1.5rem;border-radius:999px;border:1.5px solid currentColor;font-size:.8125rem;font-weight:800;line-height:1}
:where(.cf-commitment-pledge-6) .cpd-step-n svg{width:.875rem;height:.875rem}
:where(.cf-commitment-pledge-6) .cpd-step.is-done{color:var(--field-ink,#101828)}
:where(.cf-commitment-pledge-6) .cpd-step.is-done .cpd-step-n{background:var(--success);border-color:var(--success);color:var(--card);}
:where(.cf-commitment-pledge-6) .cpd-step.is-now{background:var(--band,#0f2747);color:var(--band-ink,#fff);box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6),inset 0 -2px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2))}
:where(.cf-commitment-pledge-6) .cpd-step.is-now .cpd-step-n{background:var(--band-ink,#fff);border-color:var(--band-ink,#fff);color:var(--band,#0f2747)}
:where(.cf-commitment-pledge-6) .cpd-head{margin-top:clamp(2rem,4.5vw,2.75rem);text-align:center}
:where(.cf-commitment-pledge-6) .cpd-title{margin-inline:auto;font-family:var(--font-display,Georgia,serif);font-size:clamp(2.5rem,7.8vw,4.5rem);line-height:1.02;color:var(--ink,#101828);text-wrap:balance;text-shadow:none;font-weight:var(--display-weight,900);letter-spacing:var(--display-tracking,-.032em);text-transform:var(--display-case,none);}
:where(.cf-commitment-pledge-6) .cpd-title em{font-style:italic;color:var(--cpd-pen)}
:where(.cf-commitment-pledge-6) .cpd-lead{margin:1.75rem auto 0;max-width:34ch;font-size:clamp(1.125rem,2.4vw,1.375rem);font-weight:500;line-height:1.45;color:color-mix(in oklch,var(--ink,#101828) 84%,var(--cpd-paper));text-wrap:pretty}
:where(.cf-commitment-pledge-6) .cpd-form{margin-top:clamp(1.75rem,4vw,2.25rem)}
:where(.cf-commitment-pledge-6) .cpd-pledge{position:relative;min-width:0;border:1px solid oklch(from var(--ink) l c h / 0.10);padding:1.125rem clamp(1rem,3vw,1.75rem) clamp(1.25rem,3vw,1.75rem);background:color-mix(in oklch,var(--ink) 4%,var(--card));border-radius:var(--card-radius,var(--radius));box-shadow:none;}
:where(.cf-commitment-pledge-6) .cpd-legend{padding:.375rem .875rem;margin-left:-.25rem;border:1.5px solid var(--cpd-rule);font-family:var(--font-display,Georgia,serif);font-weight:800;font-size:1.0625rem;line-height:1.2;color:var(--ink,#101828);background:var(--card);border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius));box-shadow:none;}
:where(.cf-commitment-pledge-6) .cpd-grid{display:grid;grid-template-columns:minmax(0,1fr) clamp(8.5rem,18vw,11rem);gap:clamp(1.25rem,3vw,2rem);align-items:start;margin-top:.75rem}
:where(.cf-commitment-pledge-6) .cpd-grid.no-seal{grid-template-columns:minmax(0,1fr)}
:where(.cf-commitment-pledge-6) .cpd-main{min-width:0}
:where(.cf-commitment-pledge-6) .cpd-commit{position:relative;display:flex;align-items:center;gap:1rem;min-height:4.5rem;padding:.875rem 1.125rem;background:var(--field,#fff);color:var(--field-ink,#101828);border:2px solid var(--cpd-line);cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease,transform .15s ease;border-radius:var(--field-radius,var(--radius));box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6),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));}
:where(.cf-commitment-pledge-6) .cpd-commit:hover{border-color:oklch(from var(--ink) l c h / 0.6)}
:where(.cf-commitment-pledge-6) .cpd-commit:active{transform:translateY(1px)}
:where(.cf-commitment-pledge-6) .cpd-commit.is-on{border-color:var(--success);box-shadow:inset 0 0 0 1px var(--success);}
:where(.cf-commitment-pledge-6) .cpd-commit.is-invalid{border-color:var(--cpd-err);box-shadow:inset 0 0 0 1px var(--cpd-err)}
:where(.cf-commitment-pledge-6) .cpd-commit:has(input:focus-visible){outline:3px solid var(--accent,#0f5fc2);outline-offset:3px}
:where(.cf-commitment-pledge-6) .cpd-commit:has(input:disabled){cursor:default;transform:none}
:where(.cf-commitment-pledge-6) .cpd-box{flex:none;display:grid;place-items:center;width:2.125rem;height:2.125rem;border:2px solid oklch(from var(--field-ink,var(--ink)) l c h / 0.5);background:var(--field,#fff);transition:background-color .2s ease,border-color .2s ease;color:var(--field-ink);border-radius:var(--field-radius,var(--radius));border-color:var(--field-border,oklch(from var(--ink) l c h / 0.22));box-shadow:var(--card-shadow,inset 0 2px 3px oklch(from var(--card) calc(l - 0.12) c h / 0.35));}
:where(.cf-commitment-pledge-6) .cpd-box svg{width:1.375rem;height:1.375rem;opacity:0;transform:scale(.3) rotate(-12deg);transition:opacity .2s ease,transform .32s cubic-bezier(.3,1.6,.5,1)}
:where(.cf-commitment-pledge-6) .cpd-commit.is-on .cpd-box{background:var(--success-soft);color:var(--success);border-color:var(--success);box-shadow:var(--card-shadow,inset 0 -2px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35));}
:where(.cf-commitment-pledge-6) .cpd-commit.is-on .cpd-box svg{opacity:1;transform:none}
:where(.cf-commitment-pledge-6) .cpd-commit.is-invalid .cpd-box{border-color:var(--cpd-err)}
:where(.cf-commitment-pledge-6) .cpd-commit-copy{display:grid;gap:.3125rem;min-width:0}
:where(.cf-commitment-pledge-6) .cpd-commit-text{font-family:var(--font-display,Georgia,serif);font-weight:800;font-size:clamp(1.1875rem,2.8vw,1.625rem);line-height:1.18;letter-spacing:-.012em;text-wrap:balance}
:where(.cf-commitment-pledge-6) .cpd-commit-detail{font-size:1rem;line-height:1.4;text-wrap:pretty;color:var(--field-ink);}
:where(.cf-commitment-pledge-6) .cpd-name{margin-top:1.25rem}
:where(.cf-commitment-pledge-6) .cpd-name-label{display:block;margin-bottom:.5rem;font-family:var(--font-display,Georgia,serif);font-weight:700;font-size:1.125rem;line-height:1.25;color:var(--label-ink,var(--ink));}
:where(.cf-commitment-pledge-6) .cpd-sigline{position:relative}
:where(.cf-commitment-pledge-6) .cpd-sigline-icon{position:absolute;left:1.125rem;top:50%;width:1.375rem;height:1.375rem;margin-top:-.6875rem;pointer-events:none;color:var(--field-ink);}
:where(.cf-commitment-pledge-6) .cpd-input{display:block;width:100%;height:4.75rem;margin:0;padding:.25rem 1.25rem 0 3.25rem;background:var(--field,#fff);font-size:2.75rem;line-height:1.2;border:2px solid var(--cpd-line);box-shadow:inset 0 2px 4px oklch(from var(--card) calc(l - 0.12) c h / 0.35);outline:none;transition:border-color .2s ease,box-shadow .2s ease;color:var(--field-ink);font-family:var(--signature-font,var(--signature-face,var(--font-display)));border-radius:var(--field-radius,var(--radius));}
:where(.cf-commitment-pledge-6) .cpd-input::placeholder{font-family:var(--font-body,Georgia,serif);font-size:1.125rem;font-style:italic;opacity:1;color:color-mix(in oklch, var(--field-ink) 65%, var(--field));}
:where(.cf-commitment-pledge-6) .cpd-input:hover{border-color:oklch(from var(--ink) l c h / 0.55)}
:where(.cf-commitment-pledge-6) .cpd-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 / 0.22);}
:where(.cf-commitment-pledge-6) .cpd-sigline.is-invalid .cpd-input{border-color:var(--cpd-err);box-shadow:inset 0 0 0 1px var(--cpd-err)}
:where(.cf-commitment-pledge-6) .cpd-pledge:disabled .cpd-commit,:where(.cf-commitment-pledge-6) .cpd-pledge:disabled .cpd-input{cursor:not-allowed;background:var(--field);}
:where(.cf-commitment-pledge-6) .cpd-err{display:flex;align-items:flex-start;gap:.4375rem;margin-top:.5rem;font-size:.9375rem;font-weight:600;line-height:1.35;color:var(--cpd-err);text-wrap:pretty}
:where(.cf-commitment-pledge-6) .cpd-err svg{flex:none;width:1.125rem;height:1.125rem;margin-top:.0625rem}
:where(.cf-commitment-pledge-6) .cpd-seal{display:grid;justify-items:center;gap:.75rem;text-align:center}
:where(.cf-commitment-pledge-6) .cpd-seal-slot{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:1;border-radius:999px;border:2px dashed var(--cpd-rule);transition:border-color .3s ease,background-color .3s ease,box-shadow .3s ease;background:transparent;border-color:transparent;box-shadow:none;}
:where(.cf-commitment-pledge-6) .cpd-seal-shadow{position:absolute;left:16%;right:16%;bottom:3%;height:14%;border-radius:50%;filter:blur(9px);opacity:0;transition:opacity .4s ease .35s;background:none;}
:where(.cf-commitment-pledge-6) .cpd-seal img{position:relative;display:block;width:80%;height:80%;object-fit:contain;transition:opacity .3s ease;mix-blend-mode:normal;opacity:1;filter:drop-shadow(0 2px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.28));}
:where(.cf-commitment-pledge-6) .cpd-seal figcaption{font-family:var(--font-display,Georgia,serif);font-weight:700;font-size:.9375rem;line-height:1.3;color:var(--muted,#4a5565);text-wrap:balance}
:where(.cf-commitment-pledge-6) .cpd-rule{margin:clamp(1.5rem,3.5vw,2rem) 0 1.25rem;border-top:2px dashed var(--cpd-rule)}
:where(.cf-commitment-pledge-6) .cpd-status{display:flex;align-items:center;justify-content:center;gap:.75rem;max-width:42rem;margin-inline:auto;text-align:center;font-family:var(--font-display,Georgia,serif);font-weight:700;font-size:clamp(1.0625rem,2.3vw,1.25rem);line-height:1.35;color:var(--ink,#101828)}
:where(.cf-commitment-pledge-6) .cpd-status-text{display:block;min-width:0;text-align:center;text-wrap:balance}
:where(.cf-commitment-pledge-6) .cpd-status-icon{display:inline-block;width:1.2em;height:1.2em;margin-right:.45em;vertical-align:-.24em}
:where(.cf-commitment-pledge-6) .cpd-status.is-idle{color:color-mix(in oklch,var(--ink,#101828) 86%,var(--cpd-paper))}
:where(.cf-commitment-pledge-6) .cpd-status.is-error{color:var(--cpd-err)}
:where(.cf-commitment-pledge-6) .cpd-status.is-disabled{color:var(--muted,#4a5565)}
:where(.cf-commitment-pledge-6) .cpd-actions{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-top:1.25rem}
:where(.cf-commitment-pledge-6) .cpd-go{display:grid;justify-items:center;gap:.5rem;width:min(100%,22rem)}
:where(.cf-commitment-pledge-6) .cpd-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;min-height:3.875rem;padding:.75rem 1.5rem;border:1px solid var(--cta-2,#b42318);letter-spacing:-.005em;text-align:center;text-decoration:none;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;background:linear-gradient(180deg in oklch,var(--button-bg,var(--cta)),var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h)));color:var(--button-ink,var(--cta-ink));border-color:var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h));border-radius:var(--button-radius,var(--radius));font:var(--button-weight,800) clamp(1.125rem,2.4vw,1.3125rem)/1.15 var(--button-font,var(--font-display));text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));text-transform:var(--button-case,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-commitment-pledge-6) .cpd-btn:hover,:where(.cf-commitment-pledge-6) .cpd-btn.is-hover{transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-commitment-pledge-6) .cpd-btn:active,:where(.cf-commitment-pledge-6) .cpd-btn.is-active{transform:translateY(2px);filter:none;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-commitment-pledge-6) .cpd-btn:focus-visible{outline:3px solid var(--accent,#0f5fc2);outline-offset:4px}
:where(.cf-commitment-pledge-6) .cpd-btn.is-loading{cursor:progress;transform:none}
:where(.cf-commitment-pledge-6) .cpd-btn:disabled:not(.is-loading){cursor:not-allowed;text-shadow:none;transform:none;filter:none;background:var(--button-2-bg,var(--card));color:var(--button-2-ink,var(--ink));border-color:var(--button-2-border,oklch(from var(--ink) l c h / 0.22));border-radius:var(--button-radius,var(--radius));box-shadow:var(--button-shadow,none);}
:where(.cf-commitment-pledge-6) .cpd-spin{flex:none;width:1.375rem;height:1.375rem;animation:cpd-spin .8s linear infinite}
:where(.cf-commitment-pledge-6) .cpd-note{font-size:.9375rem;line-height:1.35;color:var(--muted,#4a5565);text-align:center;text-wrap:pretty}
:where(.cf-commitment-pledge-6) .cpd-btn2{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:3.5rem;padding:.625rem 1.375rem;border:2px solid oklch(from var(--field-ink,var(--ink)) l c h / 0.65);text-decoration:none;cursor:pointer;transition:transform .16s ease,background-color .16s ease,box-shadow .16s ease;background:var(--button-2-bg, var(--secondary, oklch(0.93 0.01 260)));color:var(--button-2-ink, var(--secondary-ink, var(--ink)));border-color:var(--button-2-border, transparent);border-radius:var(--button-radius,var(--radius));box-shadow:var(--button-2-shadow, var(--shadow-sm));font:var(--button-weight,800) 1.0625rem/1.15 var(--button-font,var(--font-display));text-transform:var(--button-case,none);}
:where(.cf-commitment-pledge-6) .cpd-btn2:hover{transform:translateY(-1px);background:oklch(from var(--button-2-bg, var(--secondary, oklch(0.93 0.01 260))) calc(l - 0.03) c h);}
:where(.cf-commitment-pledge-6) .cpd-btn2:active{transform:translateY(1px);box-shadow:var(--button-2-shadow, var(--shadow-sm))}
:where(.cf-commitment-pledge-6) .cpd-btn2:focus-visible{outline:3px solid var(--accent,#0f5fc2);outline-offset:3px}
:where(.cf-commitment-pledge-6) .cpd-btn2:disabled{cursor:not-allowed;transform:none;box-shadow:none;color:var(--button-2-ink, var(--secondary-ink, var(--ink)));border-color:var(--button-2-border, transparent);}
@keyframes cpd-spin{to{transform:rotate(360deg)}}
@media (max-width:40rem){
:where(.cf-commitment-pledge-6) .cpd-grid{grid-template-columns:minmax(0,1fr)}
:where(.cf-commitment-pledge-6) .cpd-seal{grid-template-columns:5.5rem minmax(0,1fr);justify-items:start;align-items:center;gap:1rem;text-align:left}
:where(.cf-commitment-pledge-6) .cpd-seal-slot{width:5.5rem}
:where(.cf-commitment-pledge-6) .cpd-actions{flex-direction:column-reverse;align-items:stretch}
:where(.cf-commitment-pledge-6) .cpd-go{width:100%}
:where(.cf-commitment-pledge-6) .cpd-btn2{width:100%}
}
@media (max-width:26rem){
:where(.cf-commitment-pledge-6) .cpd-step{gap:.375rem;padding-inline:.25rem;font-size:.875rem}
:where(.cf-commitment-pledge-6) .cpd-step-n{width:1.25rem;height:1.25rem;font-size:.75rem}
:where(.cf-commitment-pledge-6) .cpd-step-n svg{width:.75rem;height:.75rem}
:where(.cf-commitment-pledge-6) .cpd-commit{gap:.75rem;padding:.75rem .875rem}
:where(.cf-commitment-pledge-6) .cpd-box{width:1.875rem;height:1.875rem}
:where(.cf-commitment-pledge-6) .cpd-input{font-size:2.375rem;padding-left:3rem}
:where(.cf-commitment-pledge-6) .cpd-sigline-icon{left:.875rem}
:where(.cf-commitment-pledge-6) .cpd-legend{font-size:1rem}
}
@media (prefers-reduced-motion:reduce){
.cf-commitment-pledge-6 *,.cf-commitment-pledge-6 *::before,.cf-commitment-pledge-6 *::after{animation:none!important;transition:none!important}
:where(.cf-commitment-pledge-6) .cpd-btn:hover,:where(.cf-commitment-pledge-6) .cpd-btn.is-hover,:where(.cf-commitment-pledge-6) .cpd-btn2:hover{transform:none}
}
`
export default CommitmentPledge6
export { CommitmentPledge6 as CommitmentPledgeDocument }
export type CommitmentPledgeDocumentProps = CommitmentPledge6Props
const defaultCopy = {
"legend": "Your {dayCount}-day pledge",
"pledge": "I commit to showing up for all {dayCount} days.",
"detail": "Day 1 through Day {dayCount} of the {eventName}.",
"doneNote": "You’re set for all {dayCount} days.",
"step": "Step {current} of {total}",
"complete": "{percent}% complete",
"progress": "Signup progress",
"steps": "Signup steps",
"completed": " (completed)",
"signedBy": "Signed by",
"name": "Your name",
"signed": "Signed",
"signedDate": "Signed {date}"
}
function text(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => String(values[key] ?? match))
}
pieces/forms/commitment-pledge-6/specimen.tsx 23 lines
import __studioImage8b6f7c81 from "../assets/81d28beed54f4c0b.webp";
'use client'
import * as React from 'react'
import { slot } from '../../slots'
import { CommitmentPledge6, type CommitmentPledgeDocumentState } from '../commitment-pledge-6'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function CommitmentPledgeDocumentSpecimen({ state = 'default' }: { state?: string }) {
const registration = defaults.sample.registration
const current = (states.includes(state) ? state : 'default') as CommitmentPledgeDocumentState
return (
<CommitmentPledge6
eventName={registration.name}
dayCount={5}
state={current}
sealGuaranteeImage={slot("seal-guarantee", __studioImage8b6f7c81)}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalCommitmentPledge6 |
Partial<typeof defaultCopy> |
|
onSubmit OptionalCommitmentPledge6 |
(pledge: { name: string }) => void | Promise<void> |
|
href OptionalCommitmentPledge6 |
string |
|
onAction OptionalCommitmentPledge6 |
() => void |
|
sealGuaranteeImage OptionalCommitmentPledge6 |
string |
|
eventName OptionalCommitmentPledge6 |
string |
|
dayCount OptionalCommitmentPledge6 |
number |
Default 5
|
steps OptionalCommitmentPledge6 |
string[] |
Default ['Register', 'Commit', 'Join']
|
currentStep OptionalCommitmentPledge6 |
number |
Default 1
|
headline OptionalCommitmentPledge6 |
React.ReactNode |
Default (
<>
Make your <em>commitment.</em>
</>
)
|
lead OptionalCommitmentPledge6 |
string |
Default 'A clear plan starts with showing up.'
|
legend OptionalCommitmentPledge6 |
string |
|
signedLegend OptionalCommitmentPledge6 |
string |
|
pledge OptionalCommitmentPledge6 |
string |
|
pledgeDetail OptionalCommitmentPledge6 |
string |
|
nameLabel OptionalCommitmentPledge6 |
string |
Default 'Sign with your full name'
|
namePlaceholder OptionalCommitmentPledge6 |
string |
Default 'Type your full name'
|
label OptionalCommitmentPledge6 |
string |
Default 'Sign My Pledge'
|
loadingLabel OptionalCommitmentPledge6 |
string |
Default 'Signing your pledge…'
|
reassurance OptionalCommitmentPledge6 |
string |
Default 'Takes 10 seconds. You can edit it later.'
|
backLabel OptionalCommitmentPledge6 |
string |
Default 'Back'
|
idleNote OptionalCommitmentPledge6 |
string |
Default 'Tick the pledge and sign your name to lock it in.'
|
errorNote OptionalCommitmentPledge6 |
string |
Default 'Almost there. Finish the step above to sign.'
|
checkErrorText OptionalCommitmentPledge6 |
string |
Default 'Tick the pledge to make it official.'
|
nameErrorText OptionalCommitmentPledge6 |
string |
Default 'Type your full name to sign your pledge.'
|
successMessage OptionalCommitmentPledge6 |
string |
|
successNote OptionalCommitmentPledge6 |
string |
|
joinLabel OptionalCommitmentPledge6 |
string |
|
joinHref OptionalCommitmentPledge6 |
string |
|
calendarLabel OptionalCommitmentPledge6 |
string |
|
calendarHref OptionalCommitmentPledge6 |
string |
|
editLabel OptionalCommitmentPledge6 |
string |
|
disabledNote OptionalCommitmentPledge6 |
string |
Default 'Your pledge opens as soon as your registration is confirmed.'
|
sealImage OptionalCommitmentPledge6 |
string |
|
sealAlt OptionalCommitmentPledge6 |
string |
|
sealCaption OptionalCommitmentPledge6 |
string |
Default 'Your seal is pressed the moment you sign'
|
sealCaptionDone OptionalCommitmentPledge6 |
string |
|
defaultName OptionalCommitmentPledge6 |
string |
|
disabled OptionalCommitmentPledge6 |
boolean |
Default false
|
state OptionalCommitmentPledge6 |
CommitmentPledgeDocumentState |
Default 'default'
|
onBack OptionalCommitmentPledge6 |
() => void |
|
onCommit OptionalCommitmentPledge6 |
(pledge: { name: string }) => void | Promise<void> |
|
onJoin OptionalCommitmentPledge6 |
() => void |
|
onAddToCalendar OptionalCommitmentPledge6 |
() => void |
|
className OptionalCommitmentPledge6 |
string |
|
style OptionalCommitmentPledge6 |
React.CSSProperties |
|
copy OptionalCommitmentPledgeDocument |
Partial<typeof defaultCopy> |
|
onSubmit OptionalCommitmentPledgeDocument |
(pledge: { name: string }) => void | Promise<void> |
|
href OptionalCommitmentPledgeDocument |
string |
|
onAction OptionalCommitmentPledgeDocument |
() => void |
|
sealGuaranteeImage OptionalCommitmentPledgeDocument |
string |
|
eventName OptionalCommitmentPledgeDocument |
string |
|
dayCount OptionalCommitmentPledgeDocument |
number |
|
steps OptionalCommitmentPledgeDocument |
string[] |
|
currentStep OptionalCommitmentPledgeDocument |
number |
|
headline OptionalCommitmentPledgeDocument |
React.ReactNode |
|
lead OptionalCommitmentPledgeDocument |
string |
|
legend OptionalCommitmentPledgeDocument |
string |
|
signedLegend OptionalCommitmentPledgeDocument |
string |
|
pledge OptionalCommitmentPledgeDocument |
string |
|
pledgeDetail OptionalCommitmentPledgeDocument |
string |
|
nameLabel OptionalCommitmentPledgeDocument |
string |
|
namePlaceholder OptionalCommitmentPledgeDocument |
string |
|
label OptionalCommitmentPledgeDocument |
string |
|
loadingLabel OptionalCommitmentPledgeDocument |
string |
|
reassurance OptionalCommitmentPledgeDocument |
string |
|
backLabel OptionalCommitmentPledgeDocument |
string |
|
idleNote OptionalCommitmentPledgeDocument |
string |
|
errorNote OptionalCommitmentPledgeDocument |
string |
|
checkErrorText OptionalCommitmentPledgeDocument |
string |
|
nameErrorText OptionalCommitmentPledgeDocument |
string |
|
successMessage OptionalCommitmentPledgeDocument |
string |
|
successNote OptionalCommitmentPledgeDocument |
string |
|
joinLabel OptionalCommitmentPledgeDocument |
string |
|
joinHref OptionalCommitmentPledgeDocument |
string |
|
calendarLabel OptionalCommitmentPledgeDocument |
string |
|
calendarHref OptionalCommitmentPledgeDocument |
string |
|
editLabel OptionalCommitmentPledgeDocument |
string |
|
disabledNote OptionalCommitmentPledgeDocument |
string |
|
sealImage OptionalCommitmentPledgeDocument |
string |
|
sealAlt OptionalCommitmentPledgeDocument |
string |
|
sealCaption OptionalCommitmentPledgeDocument |
string |
|
sealCaptionDone OptionalCommitmentPledgeDocument |
string |
|
defaultName OptionalCommitmentPledgeDocument |
string |
|
disabled OptionalCommitmentPledgeDocument |
boolean |
|
state OptionalCommitmentPledgeDocument |
CommitmentPledgeDocumentState |
|
onBack OptionalCommitmentPledgeDocument |
() => void |
|
onCommit OptionalCommitmentPledgeDocument |
(pledge: { name: string }) => void | Promise<void> |
|
onJoin OptionalCommitmentPledgeDocument |
() => void |
|
onAddToCalendar OptionalCommitmentPledgeDocument |
() => void |
|
className OptionalCommitmentPledgeDocument |
string |
|
style OptionalCommitmentPledgeDocument |
React.CSSProperties |
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.
seal-guarantee- The money-back guarantee seal, on a transparent background.
-
81d28beed54f4c0b.webp
image/webp · 296 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB