Calendar Actions 4
A thank-you-page hello-strip: the event in the visitor’s own clock plus four one-tap ways to save it, captured at the moment of highest intent.
Use it in a prompt
Use checkout/calendar-actions-4 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/calendar-actions-4.tsx. - Import it and pass your copy and images (Props tab):
import { CalendarActions4 } from "@/components/funneldna/checkout/calendar-actions-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/calendar-actions-4/component.tsx 791 lines
// layout: hello-strip
// A thank-you-page hello-strip: the event in the visitor’s own clock plus four one-tap ways to save it, captured at the moment of highest intent.
'use client'
import * as React from 'react'
import { CalendarClock, Check, ChevronDown, Clock, Download, Link2 } from 'lucide-react'
export type CalendarAction = 'google' | 'outlook' | 'ics' | 'copy'
export type CalendarActions4State = 'default' | 'hover' | 'active' | 'disabled' | 'success'
export type CalendarActions4Copy = {
/** Bold lead-in before the event title. */
leadIn: string
/** Visible local time; placeholders {date} and {time}. */
timeTemplate: string
/** Words after the local time, before the zone chip. */
yourTime: string
googleLabel: string
outlookLabel: string
icsLabel: string
copyLabel: string
/** Shown briefly inside the copy button after a copy. */
copiedLabel: string
copyFailedLabel: string
/** Accessible labels; placeholder {title}. */
regionLabel: string
groupLabel: string
googleAction: string
outlookAction: string
icsAction: string
copyAction: string
/** Time button accessible label; placeholder {when}. */
timeAction: string
popoverTitle: string
/** Popover row labels; placeholder {city}. */
yourTimeRow: string
hostTimeRow: string
utcRow: string
/** Popover footnote; placeholders {minutes} and {end}. */
durationNote: string
}
export type CalendarActions4Props = {
/** The event title as it should appear in their calendar. */
title: string
/** ISO 8601 with zone info, e.g. '2026-12-03T00:00:00Z'. */
startsAt: string
/** Defaults to one hour after start. */
endsAt?: string
/** IANA zone the host announces the event in, e.g. 'America/New_York'. */
timezone: string
/** Join URL for online events, a venue otherwise. */
location?: string
description?: string
/** What the copy button copies (join or replay page); falls back to an http location, then the Google link. */
link?: string
/** Overrides the visitor’s detected zone (previews, tests). */
viewerTimezone?: string
/** Locale for weekday, date and time labels. */
locale?: string
hour12?: boolean
/** Pin the strip to the top of the page like a hello bar. */
sticky?: boolean
copy?: Partial<CalendarActions4Copy>
/** Called on each save action; call event.preventDefault() to stop the default (open, download or copy). */
onAction?: (action: CalendarAction, event: React.MouseEvent<HTMLElement>) => void
/** Studio preview: Google button hovered or pressed, all saves disabled, or the copy button’s Copied label. */
state?: CalendarActions4State
className?: string
}
type CopyState = 'idle' | 'copied' | 'failed'
type ZoneClock = { date: string; time: string; zone: string; city: string; full: string }
const DEFAULT_COPY: CalendarActions4Copy = {
leadIn: 'Don’t miss it live:',
timeTemplate: '{date}, {time}',
yourTime: 'your time',
googleLabel: 'Google',
outlookLabel: 'Outlook',
icsLabel: '.ics file',
copyLabel: 'Copy link',
copiedLabel: 'Copied',
copyFailedLabel: 'Copy failed',
regionLabel: 'Save {title} to your calendar',
groupLabel: 'Add {title} to your calendar',
googleAction: 'Add {title} to Google Calendar',
outlookAction: 'Add {title} to Outlook Calendar',
icsAction: 'Download {title} as a calendar file (.ics)',
copyAction: 'Copy the link to {title}',
timeAction: '{when}. Show the host’s time and UTC',
popoverTitle: 'Same live moment, three clocks',
yourTimeRow: 'Your time · {city}',
hostTimeRow: 'Host’s time · {city}',
utcRow: 'Universal time · UTC',
durationNote: 'Runs {minutes} minutes, ending {end}.',
}
const HOUR = 60 * 60 * 1000
export function CalendarActions4({
title,
startsAt,
endsAt,
timezone,
location,
description,
link,
viewerTimezone,
locale = 'en-GB',
hour12 = true,
sticky = false,
copy: copyOverrides,
onAction,
state = 'default',
className,
}: CalendarActions4Props) {
const copy = mergeCopy(copyOverrides)
const [open, setOpen] = React.useState(false)
const [copyState, setCopyState] = React.useState<CopyState>('idle')
const wrapRef = React.useRef<HTMLDivElement>(null)
const triggerRef = React.useRef<HTMLButtonElement>(null)
const timerRef = React.useRef<number | null>(null)
const uid = React.useId()
const popId = `${uid}zones`
const popTitleId = `${uid}zones-title`
React.useEffect(
() => () => {
if (timerRef.current !== null) window.clearTimeout(timerRef.current)
},
[],
)
React.useEffect(() => {
if (!open) return
const onPointer = (event: PointerEvent) => {
const wrap = wrapRef.current
if (wrap && event.target instanceof Node && !wrap.contains(event.target)) setOpen(false)
}
const onKey = (event: KeyboardEvent) => {
if (event.key === 'Escape') {
setOpen(false)
triggerRef.current?.focus()
}
}
document.addEventListener('pointerdown', onPointer)
document.addEventListener('keydown', onKey)
return () => {
document.removeEventListener('pointerdown', onPointer)
document.removeEventListener('keydown', onKey)
}
}, [open])
const start = new Date(startsAt)
if (Number.isNaN(start.getTime())) return null
const parsedEnd = endsAt ? new Date(endsAt) : null
const end =
parsedEnd && !Number.isNaN(parsedEnd.getTime()) && parsedEnd.getTime() > start.getTime()
? parsedEnd
: new Date(start.getTime() + HOUR)
const loc = safeLocale(locale)
const viewerZone = viewerTimezone || detectZone()
const local = clockFor(start, viewerZone, loc, hour12)
const host = clockFor(start, timezone, loc, hour12)
const utc = clockFor(start, 'UTC', loc, hour12)
const localEnd = clockFor(end, viewerZone, loc, hour12)
const localMain = formatCopy(copy.timeTemplate, { date: local.date, time: local.time })
const minutes = String(Math.round((end.getTime() - start.getTime()) / 60000))
const disabled = state === 'disabled'
const shown: CopyState = state === 'success' ? 'copied' : copyState
const hostZone = isZone(timezone) ? timezone : 'UTC'
const googleHref =
'https://calendar.google.com/calendar/render?action=TEMPLATE' +
`&text=${encodeURIComponent(title)}` +
`&dates=${toBasicUtc(start)}/${toBasicUtc(end)}` +
`&ctz=${encodeURIComponent(hostZone)}` +
(location ? `&location=${encodeURIComponent(location)}` : '') +
(description ? `&details=${encodeURIComponent(description)}` : '')
const outlookHref =
'https://outlook.live.com/calendar/0/action/compose?rru=addevent' +
`&subject=${encodeURIComponent(title)}` +
`&startdt=${encodeURIComponent(start.toISOString())}` +
`&enddt=${encodeURIComponent(end.toISOString())}` +
(location ? `&location=${encodeURIComponent(location)}` : '') +
(description ? `&body=${encodeURIComponent(description)}` : '')
const ics = [
'BEGIN:VCALENDAR',
'VERSION:2.0',
'PRODID:-//funnel//calendar-actions-4//EN',
'BEGIN:VEVENT',
`UID:${toBasicUtc(start)}-${slugify(title)}`,
`DTSTAMP:${toBasicUtc(start)}`,
`DTSTART:${toBasicUtc(start)}`,
`DTEND:${toBasicUtc(end)}`,
`SUMMARY:${escapeIcs(title)}`,
...(location ? [`LOCATION:${escapeIcs(location)}`] : []),
...(description ? [`DESCRIPTION:${escapeIcs(description)}`] : []),
'END:VEVENT',
'END:VCALENDAR',
].join(CRLF)
const icsHref = `data:text/calendar;charset=utf-8,${encodeURIComponent(ics)}`
const shareLink = link || (location && /^https?:/i.test(location) ? location : googleHref)
const links: Array<{
id: Exclude<CalendarAction, 'copy'>
label: string
aria: string
href: string
icon: React.ReactNode
external: boolean
download?: string
}> = [
{ id: 'google', label: copy.googleLabel, aria: formatCopy(copy.googleAction, { title }), href: googleHref, icon: <GoogleMark />, external: true },
{ id: 'outlook', label: copy.outlookLabel, aria: formatCopy(copy.outlookAction, { title }), href: outlookHref, icon: <OutlookMark />, external: true },
{
id: 'ics',
label: copy.icsLabel,
aria: formatCopy(copy.icsAction, { title }),
href: icsHref,
icon: <Download size={18} strokeWidth={2.5} aria-hidden='true' />,
external: false,
download: `${slugify(title) || 'event'}.ics`,
},
]
const handleLink = (action: Exclude<CalendarAction, 'copy'>) => (event: React.MouseEvent<HTMLAnchorElement>) => {
if (disabled) {
event.preventDefault()
return
}
onAction?.(action, event)
}
const handleCopy = (event: React.MouseEvent<HTMLButtonElement>) => {
if (disabled) return
onAction?.('copy', event)
if (event.defaultPrevented) return
void writeClipboard(shareLink).then((ok) => {
setCopyState(ok ? 'copied' : 'failed')
if (timerRef.current !== null) window.clearTimeout(timerRef.current)
timerRef.current = window.setTimeout(() => {
timerRef.current = null
setCopyState('idle')
}, 2200)
})
}
const liveMessage = copyState === 'copied' ? copy.copiedLabel : copyState === 'failed' ? copy.copyFailedLabel : ''
return (
<section
className={cx('cf-calendar-actions-4', className)}
data-state={state}
data-sticky={sticky ? 'true' : undefined}
aria-label={formatCopy(copy.regionLabel, { title })}
>
<style>{CSS}</style>
<div className='cfc4-inner'>
<div className='cfc4-event'>
<div className='cfc4-lead-wrap'>
<span className='cfc4-disc' aria-hidden='true'>
<CalendarClock size={20} strokeWidth={2.5} />
</span>
<p className='cfc4-lead'>
<strong>{copy.leadIn}</strong> <span className='cfc4-title'>{title}</span>
</p>
</div>
<div className='cfc4-time-wrap' ref={wrapRef}>
<button
ref={triggerRef}
type='button'
className='cfc4-time'
aria-expanded={open}
aria-controls={popId}
aria-haspopup='dialog'
aria-label={formatCopy(copy.timeAction, { when: `${localMain} ${copy.yourTime} (${local.zone})` })}
onClick={() => setOpen((value) => !value)}
>
<Clock className='cfc4-time-icon' size={18} strokeWidth={2.5} aria-hidden='true' />
<span className='cfc4-time-text'>
<span className='cfc4-time-main' suppressHydrationWarning>
{localMain}
</span>{' '}
<span className='cfc4-time-yours'>{copy.yourTime}</span>
</span>
<span className='cfc4-zone' suppressHydrationWarning>
{local.zone}
</span>
<ChevronDown className='cfc4-chev' size={18} strokeWidth={2.5} aria-hidden='true' />
</button>
<div id={popId} role='dialog' aria-labelledby={popTitleId} className='cfc4-pop' hidden={!open}>
<p id={popTitleId} className='cfc4-pop-title'>
{copy.popoverTitle}
</p>
<ul className='cfc4-rows'>
<li className='cfc4-row' data-you='true'>
<span className='cfc4-row-label' suppressHydrationWarning>
{formatCopy(copy.yourTimeRow, { city: local.city })}
</span>
<span className='cfc4-row-value' suppressHydrationWarning>
{local.full}
</span>
</li>
<li className='cfc4-row'>
<span className='cfc4-row-label'>{formatCopy(copy.hostTimeRow, { city: host.city })}</span>
<span className='cfc4-row-value'>{host.full}</span>
</li>
<li className='cfc4-row'>
<span className='cfc4-row-label'>{copy.utcRow}</span>
<span className='cfc4-row-value'>{utc.full}</span>
</li>
</ul>
<p className='cfc4-pop-note' suppressHydrationWarning>
{formatCopy(copy.durationNote, { minutes, end: `${localEnd.time} ${localEnd.zone}` })}
</p>
</div>
</div>
</div>
<div className='cfc4-actions' role='group' aria-label={formatCopy(copy.groupLabel, { title })}>
{links.map((option) => (
<a
key={option.id}
className={cx('cfc4-btn', option.id === 'google' && 'cfc4-btn--demo')}
href={disabled ? undefined : option.href}
target={option.external && !disabled ? '_blank' : undefined}
rel={option.external ? 'noopener noreferrer' : undefined}
download={disabled ? undefined : option.download}
aria-label={option.aria}
aria-disabled={disabled || undefined}
tabIndex={disabled ? -1 : undefined}
onClick={handleLink(option.id)}
>
<span className='cfc4-btn-icon'>{option.icon}</span>
<span>{option.label}</span>
</a>
))}
<button
type='button'
className='cfc4-btn cfc4-btn--copy'
disabled={disabled}
aria-label={formatCopy(copy.copyAction, { title })}
onClick={handleCopy}
>
<span className='cfc4-copy-stack'>
<span data-hidden={String(shown !== 'idle')}>
<Link2 size={18} strokeWidth={2.5} aria-hidden='true' />
{copy.copyLabel}
</span>
<span data-hidden={String(shown !== 'copied')}>
<Check className='cfc4-ok' size={18} strokeWidth={2.5} aria-hidden='true' />
{copy.copiedLabel}
</span>
<span data-hidden={String(shown !== 'failed')}>{copy.copyFailedLabel}</span>
</span>
</button>
</div>
</div>
<span className='cfc4-sr' aria-live='polite'>
{liveMessage}
</span>
</section>
)
}
export default CalendarActions4
function GoogleMark() {
return (
<svg data-official-mark='Google' viewBox='0 0 24 24' width='18' height='18' aria-hidden='true' focusable='false'>
<path fill='#4285F4' d='M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z' />
<path fill='#34A853' d='M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.86-3c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96H1.29v3.09C3.26 21.3 7.31 24 12 24z' />
<path fill='#FBBC05' d='M5.27 14.29c-.25-.72-.38-1.49-.38-2.29s.14-1.57.38-2.29V6.62H1.29C.47 8.24 0 10.06 0 12s.47 3.76 1.29 5.38l3.98-3.09z' />
<path fill='#EA4335' d='M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.19 15.24 0 12 0 7.31 0 3.26 2.7 1.29 6.62l3.98 3.09c.95-2.85 3.6-4.96 6.73-4.96z' />
</svg>
)
}
function OutlookMark() {
return (
<svg data-official-mark='Microsoft Outlook' viewBox='0 0 24 24' width='18' height='18' aria-hidden='true' focusable='false'>
<rect x='9' y='4' width='13' height='16' rx='1.6' fill='#28A8EA' />
<path d='M9 9.5 15.5 13 22 9.5v8.9a1.6 1.6 0 0 1-1.6 1.6h-9.8A1.6 1.6 0 0 1 9 18.4z' fill='#0078D4' />
<rect x='2' y='6' width='12' height='12' rx='1.8' fill='#0364B8' />
<ellipse cx='8' cy='12' rx='2.7' ry='3.3' fill='none' stroke='#ffffff' strokeWidth='1.9' />
</svg>
)
}
function clockFor(date: Date, zone: string, locale: string, hour12: boolean): ZoneClock {
const z = isZone(zone) ? zone : 'UTC'
const fmt = (opts: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat(locale, { timeZone: z, ...opts }).format(date)
const day = fmt({ weekday: 'short', day: 'numeric', month: 'short' })
const time = fmt({ hour: 'numeric', minute: '2-digit', hour12 })
const label =
z === 'UTC'
? 'UTC'
: new Intl.DateTimeFormat(locale, { timeZone: z, timeZoneName: 'short' })
.formatToParts(date)
.find((part) => part.type === 'timeZoneName')?.value ?? z
const city = z === 'UTC' ? 'UTC' : (z.split('/').pop() || z).split('_').join(' ')
return { date: day, time, zone: label, city, full: `${day}, ${time} ${label}` }
}
function isZone(zone: string) {
try {
new Intl.DateTimeFormat('en', { timeZone: zone })
return true
} catch {
return false
}
}
function detectZone() {
try {
return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
} catch {
return 'UTC'
}
}
function safeLocale(locale: string) {
try {
new Intl.DateTimeFormat(locale)
return locale
} catch {
return 'en-GB'
}
}
async function writeClipboard(text: string): Promise<boolean> {
try {
if (navigator.clipboard && navigator.clipboard.writeText) {
await navigator.clipboard.writeText(text)
return true
}
} catch {
// fall through to the selection fallback
}
try {
const area = document.createElement('textarea')
area.value = text
area.setAttribute('readonly', '')
area.style.position = 'fixed'
area.style.opacity = '0'
document.body.appendChild(area)
area.select()
const ok = document.execCommand('copy')
area.remove()
return ok
} catch {
return false
}
}
function mergeCopy(overrides?: Partial<CalendarActions4Copy>): CalendarActions4Copy {
const merged: CalendarActions4Copy = { ...DEFAULT_COPY }
if (overrides) {
for (const key of Object.keys(overrides) as Array<keyof CalendarActions4Copy>) {
const value = overrides[key]
if (value !== undefined) merged[key] = value
}
}
return merged
}
function formatCopy(template: string, values: Record<string, string>) {
return Object.keys(values).reduce((text, key) => text.split('{' + key + '}').join(values[key] ?? ''), template)
}
function toBasicUtc(date: Date) {
return date.toISOString().slice(0, 19).replace(/[-:]/g, '') + 'Z'
}
function slugify(value: string) {
return value.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '')
}
const CRLF = String.fromCharCode(13, 10)
const BS = String.fromCharCode(92)
function escapeIcs(value: string) {
return value
.split(BS)
.join(BS + BS)
.split(';')
.join(BS + ';')
.split(',')
.join(BS + ',')
.split(CRLF)
.join(BS + 'n')
.split(String.fromCharCode(10))
.join(BS + 'n')
}
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ')
}
const R = '.cf-calendar-actions-4'
const CSS = `
${R}{
--cfc4-ink: var(--band-ink, oklch(1 0 0));
--cfc4-gutter: clamp(16px, 5vw, 48px);
--cfc4-ring: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.9);
--cfc4-btn-bg: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));
--cfc4-btn-ink: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263)));
position: relative;
z-index: 20;
background: var(--band, oklch(0.27 0.067 256));
color: var(--cfc4-ink);
font-family: var(--font-body);
box-shadow: inset 0 -1px 0 oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.12);
}
${R}[data-sticky='true']{ position: sticky; top: 0; }
${R} *, ${R} *::before, ${R} *::after{ box-sizing: border-box; }
${R} .cfc4-inner{
max-width: 1280px;
margin: 0 auto;
padding: clamp(12px, 1.3vw, 16px) var(--cfc4-gutter);
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
column-gap: 24px;
row-gap: 12px;
}
${R} .cfc4-event{
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 12px 16px;
min-width: 0;
}
${R} .cfc4-lead-wrap{ display: flex; align-items: center; gap: 12px; min-width: 0; }
${R} .cfc4-disc{
flex: none;
width: 40px;
height: 40px;
border-radius: 999px;
display: grid;
place-items: center;
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.7), 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 256)) l c h / 0.3);
}
${R} .cfc4-lead{
margin: 0;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.4;
text-wrap: pretty;
}
${R} .cfc4-lead strong{ font-weight: 800; }
${R} .cfc4-title{ font-weight: 500; }
${R} .cfc4-time-wrap{ position: relative; }
${R} .cfc4-time{
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 44px;
padding: 6px 12px 6px 14px;
border: 1px solid oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.28);
border-radius: var(--button-radius, var(--radius, 12px));
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.1);
color: var(--cfc4-ink);
font: inherit;
text-align: left;
cursor: pointer;
transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
${R} .cfc4-time:hover{
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.16);
border-color: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.44);
}
${R} .cfc4-time[aria-expanded='true']{
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.18);
border-color: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.5);
}
${R} .cfc4-time:active{
transform: translateY(1px);
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.07);
}
${R} .cfc4-time:focus-visible{ outline: 3px solid var(--cfc4-ring); outline-offset: 2px; }
${R} .cfc4-time-icon{ flex: none; }
${R} .cfc4-time-text{
min-width: 0;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
letter-spacing: -0.01em;
line-height: 1.2;
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
${R} .cfc4-time-main{ white-space: nowrap; }
${R} .cfc4-time-yours{ font-family: var(--font-body); font-weight: 500; letter-spacing: 0; }
${R} .cfc4-zone{
flex: none;
display: inline-flex;
align-items: center;
min-height: 26px;
padding: 2px 12px;
border-radius: 999px;
background: var(--accent-fill, var(--accent));
color: var(--accent-fill-ink, var(--card));
font-family: var(--font-body);
font-size: 0.875rem;
font-weight: 800;
line-height: 1.2;
white-space: nowrap;
font-variant-numeric: tabular-nums;
}
${R} .cfc4-chev{ flex: none; transition: transform .16s ease; }
${R} .cfc4-time[aria-expanded='true'] .cfc4-chev{ transform: rotate(180deg); }
${R} .cfc4-pop{
position: absolute;
top: calc(100% + 10px);
left: 0;
z-index: 40;
width: 340px;
max-width: calc(100vw - 2 * var(--cfc4-gutter));
padding: 16px;
background: var(--card, oklch(1 0 0));
color: var(--ink, oklch(0.21 0.034 263));
border: 1px solid var(--card-border, oklch(from var(--ink, oklch(0.21 0.034 263)) 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 256 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 256 / 0.32)));
text-align: left;
transform-origin: top left;
animation: cfc4-pop .2s cubic-bezier(.2,.7,.2,1) both;
}
${R} .cfc4-pop[hidden]{ display: none; }
@keyframes cfc4-pop{ from { opacity: .82; transform: translateY(-4px) scale(.96); } }
${R} .cfc4-pop-title{
margin: 0 0 12px;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
font-size: 1.0625rem;
line-height: 1.2;
letter-spacing: var(--display-tracking, -0.01em);
text-wrap: balance;
}
${R} .cfc4-rows{ list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
${R} .cfc4-row{
display: grid;
gap: 2px;
padding: 10px 12px;
border-radius: 10px;
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 4%, var(--card, oklch(1 0 0)));
}
${R} .cfc4-row[data-you='true']{
background: color-mix(in oklch, var(--accent, oklch(0.5 0.17 257)) 10%, var(--card, oklch(1 0 0)));
box-shadow: inset 0 0 0 1px oklch(from var(--accent, oklch(0.5 0.17 257)) l c h / 0.35);
}
${R} .cfc4-row-label{
font-size: 0.875rem;
font-weight: 700;
line-height: 1.3;
color: var(--muted, oklch(0.45 0.03 258));
}
${R} .cfc4-row[data-you='true'] .cfc4-row-label{ color: var(--ink, oklch(0.21 0.034 263)); }
${R} .cfc4-row-value{
font-family: var(--font-display);
font-weight: 800;
font-size: 1rem;
line-height: 1.3;
font-variant-numeric: tabular-nums;
color: var(--ink, oklch(0.21 0.034 263));
}
${R} .cfc4-pop-note{
margin: 12px 0 0;
font-size: 0.9375rem;
font-weight: 500;
line-height: 1.4;
color: var(--muted, oklch(0.45 0.03 258));
text-wrap: pretty;
}
${R} .cfc4-actions{ display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
${R} .cfc4-btn{
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 44px;
padding: 0 16px;
border: 1px solid var(--button-2-border, oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.14));
border-radius: var(--button-radius, var(--radius, 12px));
background: var(--cfc4-btn-bg);
color: var(--cfc4-btn-ink);
box-shadow: var(--button-2-shadow, var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 256 / 0.18), 0 1px 3px oklch(0.22 0.03 256 / 0.14)));
font-family: var(--button-font, var(--font-display));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: 0.9375rem;
line-height: 1.15;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
${R} .cfc4-btn-icon{ display: inline-flex; flex: none; }
${R} .cfc4-btn svg{ flex: none; }
${R} .cfc4-btn:not(:disabled):not([aria-disabled='true']):hover,
${R}[data-state='hover'] .cfc4-btn--demo{
background: oklch(from var(--cfc4-btn-bg) calc(l - 0.04) c h);
transform: translateY(-1px);
box-shadow: var(--shadow-md, 0 1px 2px oklch(0.22 0.03 256 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 256 / 0.2));
}
${R} .cfc4-btn:not(:disabled):not([aria-disabled='true']):active,
${R}[data-state='active'] .cfc4-btn--demo{
background: oklch(from var(--cfc4-btn-bg) calc(l - 0.08) c h);
transform: translateY(1px);
box-shadow: inset 0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 256)) l c h / 0.28);
}
${R} .cfc4-btn:focus-visible{ outline: 3px solid var(--cfc4-ring); outline-offset: 2px; }
${R} .cfc4-btn:disabled,
${R} .cfc4-btn[aria-disabled='true']{
cursor: not-allowed;
box-shadow: none;
transform: none;
color: color-mix(in oklch, var(--cfc4-btn-ink) 55%, var(--cfc4-btn-bg));
}
${R} .cfc4-btn:disabled svg,
${R} .cfc4-btn[aria-disabled='true'] svg{ opacity: .5; }
${R} .cfc4-copy-stack{ display: inline-grid; }
${R} .cfc4-copy-stack > span{
grid-area: 1 / 1;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
}
${R} .cfc4-copy-stack > [data-hidden='true']{ visibility: hidden; }
${R} .cfc4-ok{ color: var(--success, oklch(0.5 0.138 150)); }
${R} .cfc4-sr{
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
@media (max-width: 639px){
${R} .cfc4-inner{
flex-direction: column;
align-items: stretch;
padding: 14px var(--cfc4-gutter) 16px;
row-gap: 12px;
}
${R} .cfc4-event{ flex-direction: column; align-items: stretch; gap: 8px; }
${R} .cfc4-lead-wrap{ justify-content: center; }
${R} .cfc4-disc{ display: none; }
${R} .cfc4-lead{ text-align: center; font-size: 0.9375rem; }
${R} .cfc4-time-wrap{ width: 100%; }
/* Phone: one centred inline run, so the clock and chevron stay beside the words when the time wraps. */
${R} .cfc4-time{ display: block; width: 100%; padding: 8px 14px; text-align: center; text-wrap: balance; }
${R} .cfc4-time-icon, ${R} .cfc4-chev{ display: inline-block; vertical-align: -0.2em; }
${R} .cfc4-time-icon{ margin-inline-end: 8px; }
${R} .cfc4-chev{ margin-inline-start: 8px; }
${R} .cfc4-time-text{ white-space: normal; }
${R} .cfc4-zone{ display: inline-block; min-height: 0; padding: 4px 12px; margin-inline-start: 8px; vertical-align: 0.1em; }
${R} .cfc4-pop{ left: 0; right: 0; width: auto; max-width: none; transform-origin: top center; }
${R} .cfc4-actions{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
${R} .cfc4-btn{ width: 100%; min-height: 48px; padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce){
${R} .cfc4-btn, ${R} .cfc4-time, ${R} .cfc4-chev{ transition: none; }
${R} .cfc4-pop{ animation: none; }
${R} .cfc4-btn:not(:disabled):not([aria-disabled='true']):hover,
${R} .cfc4-btn:not(:disabled):not([aria-disabled='true']):active,
${R}[data-state='hover'] .cfc4-btn--demo,
${R}[data-state='active'] .cfc4-btn--demo,
${R} .cfc4-time:active{ transform: none; }
}
`
pieces/checkout/calendar-actions-4/specimen.tsx 20 lines
// Specimen: Flowpad’s Automations 101 Live on a thank-you page, shown in the visitor’s own clock.
import * as React from 'react'
import { CalendarActions4, type CalendarActions4State } from '../calendar-actions-4'
export const states = ['default', 'hover', 'active', 'disabled', 'success']
export default function CalendarActions4Specimen({ state = 'default' }: { state?: CalendarActions4State }) {
return (
<CalendarActions4
title='Automations 101 Live'
startsAt='2026-12-03T00:00:00Z'
endsAt='2026-12-03T01:00:00Z'
timezone='America/New_York'
location='https://flowpad.example/live/automations-101'
description='Build your first three Flowpad automations live, step by step. Join here: https://flowpad.example/live/automations-101'
link='https://flowpad.example/live/automations-101'
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
title RequiredCalendarActions4 |
string |
|
startsAt RequiredCalendarActions4 |
string |
|
endsAt OptionalCalendarActions4 |
string |
|
timezone RequiredCalendarActions4 |
string |
|
location OptionalCalendarActions4 |
string |
|
description OptionalCalendarActions4 |
string |
|
link OptionalCalendarActions4 |
string |
|
viewerTimezone OptionalCalendarActions4 |
string |
|
locale OptionalCalendarActions4 |
string |
Default 'en-GB'
|
hour12 OptionalCalendarActions4 |
boolean |
Default true
|
sticky OptionalCalendarActions4 |
boolean |
Default false
|
copy OptionalCalendarActions4 |
Partial<CalendarActions4Copy> |
|
onAction OptionalCalendarActions4 |
(action: CalendarAction, event: React.MouseEvent<HTMLElement>) => void |
|
state OptionalCalendarActions4 |
CalendarActions4State |
Default 'default'
|
className OptionalCalendarActions4 |
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-case--button-font--button-radius--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-tracking--display-weight- Headlines: weight, letter case and tracking.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.