Course Modules 2
Members-area module shelf: the module in progress sits large in the spotlight with its cover, progress and one resume button; the others wait on a streaming-style shelf, and picking a cover swaps it into the spotlight so the next lesson is always one click away.
Use it in a prompt
Use content/course-modules-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/content/course-modules-2.tsx. - Import it and pass your copy and images (Props tab):
import { CourseModules2 } from "@/components/funneldna/content/course-modules-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/course-modules-2/component.tsx 623 lines
// layout: spotlight-row
// Members-area module shelf: the module in progress sits large in the spotlight with its cover, progress and one resume button; the others wait on a streaming-style shelf, and picking a cover swaps it into the spotlight so the next lesson is always one click away.
import * as React from 'react'
import { Check, Clock, Inbox, Lock } from 'lucide-react'
import { FX_HOST, Glow, Spot } from '../fx/fx'
import book from '../fx/spots/book'
export type CourseModules2Lesson = {
/** Lesson number inside its module. */
number: number
title: string
/** Running time, e.g. '14 min'. */
duration?: string
}
export type CourseModules2Module = {
title: string
/** One short sentence on what the module gets the member (spotlight only). */
summary?: string
/** Cover art (slot item-n). */
image?: string
imageAlt?: string
/** CSS object-position for the cover crop, e.g. 'left center'. */
imagePosition?: string
/** Extra zoom on the cover (1 = none), anchored at imagePosition, to trim a stray crop edge. */
imageZoom?: number
/** Lessons in the module. */
lessons: number
/** Lessons the member has finished. */
done?: number
locked?: boolean
/** Supplied unlock date text, e.g. 'Dec 4'; shown only when given. */
unlocksOn?: string
/** The member's next lesson in this module. */
nextLesson?: CourseModules2Lesson
/** Destination of the spotlight button for this module. */
href?: string
}
export type CourseModules2Filter = 'all' | 'progress' | 'new'
export type CourseModules2Copy = {
/** Placeholder {n}. */
moduleLabel: string
/** Placeholder {total}. */
lessonsCount: string
/** Placeholder {total}. */
lessonsCountOne: string
/** Placeholders {done}, {total}. */
lessonsDone: string
/** Placeholders {done}, {total}. */
shelfLessons: string
/** Placeholder {percent}. */
percent: string
/** Placeholders {done}, {total}. */
overall: string
statusComplete: string
statusProgress: string
statusNew: string
statusLocked: string
/** Placeholder {number}. */
upNext: string
/** Placeholder {number}. */
firstUp: string
completeNote: string
/** Placeholder {date}. */
opensOn: string
lockedSoon: string
/** Placeholder {number}. */
instructionResume: string
/** Placeholder {number}. */
instructionStart: string
instructionReview: string
/** Placeholder {number}. */
resume: string
/** Placeholder {number}. */
start: string
review: string
/** Placeholder {date}. */
opensButton: string
lockedButton: string
/** Placeholder {n}. */
backToCurrent: string
filterGroup: string
filterAll: string
filterProgress: string
filterNew: string
shelfLabel: string
pickHint: string
emptySpotlit: string
emptyNone: string
showAll: string
progressLabel: string
/** Placeholders {n}, {title}. */
live: string
}
export type CourseModules2Props = {
/** Section headline (h2). */
headline?: React.ReactNode
lead?: React.ReactNode
modules?: CourseModules2Module[]
copy?: Partial<CourseModules2Copy>
/** Filter chip selected on first render. */
initialFilter?: CourseModules2Filter
/** Fallback destination of the spotlight button. */
href?: string
/** Spotlight button click: the module the member opens. */
onAction?: (module: CourseModules2Module, index: number) => void
/** A cover was picked and swapped into the spotlight. */
onSelect?: (module: CourseModules2Module, index: number) => void
/** Forces the spotlight button's look. */
state?: 'default' | 'hover' | 'active' | 'disabled'
className?: string
}
type Status = 'complete' | 'progress' | 'new' | 'locked'
const DEFAULT_COPY: CourseModules2Copy = {
moduleLabel: 'Module {n}',
lessonsCount: '{total} lessons',
lessonsCountOne: '{total} lesson',
lessonsDone: '{done} of {total} lessons done',
shelfLessons: '{done} of {total} lessons',
percent: '{percent}%',
overall: 'You’ve finished {done} of {total} lessons',
statusComplete: 'Complete',
statusProgress: 'In progress',
statusNew: 'Not started',
statusLocked: 'Locked',
upNext: 'Up next · Lesson {number}',
firstUp: 'First up · Lesson {number}',
completeNote: 'Every lesson done. Revisit any of them, any time.',
opensOn: 'Opens {date}',
lockedSoon: 'Not open yet',
instructionResume: 'Click the button below to jump back into Lesson {number}.',
instructionStart: 'Click the button below to start Lesson {number}.',
instructionReview: 'Click the button below to revisit any lesson.',
resume: 'Resume Lesson {number}',
start: 'Start Lesson {number}',
review: 'Review module',
opensButton: 'Opens {date}',
lockedButton: 'Not open yet',
backToCurrent: 'Keep going with Module {n}',
filterGroup: 'Filter modules',
filterAll: 'All',
filterProgress: 'In progress',
filterNew: 'Not started',
shelfLabel: 'More modules',
pickHint: 'Shows this module in the spotlight above.',
emptySpotlit: 'The only match is already in the spotlight above.',
emptyNone: 'Nothing matches this filter yet.',
showAll: 'Show all modules',
progressLabel: 'Module progress',
live: 'Now showing Module {n}: {title}',
}
const DEFAULT_MODULES: CourseModules2Module[] = [
{ title: 'Get set up for your first win', lessons: 4, done: 4 },
{
title: 'Learn the core method',
summary: 'The one method the rest of the course is built on.',
lessons: 6,
done: 2,
nextLesson: { number: 3, title: 'Practise it on a real example', duration: '12 min' },
},
{ title: 'Put the method to work', lessons: 5 },
{ title: 'Make it a weekly habit', lessons: 4, locked: true },
]
const FILTERS: CourseModules2Filter[] = ['all', 'progress', 'new']
export function CourseModules2(props: CourseModules2Props) {
const {
headline = 'Your next lesson is one click away',
lead = 'Pick up the module you started, or choose any cover below to see what’s inside.',
modules = DEFAULT_MODULES,
copy: copyProp,
initialFilter = 'all',
href,
onAction,
onSelect,
state = 'default',
className,
} = props
const copy: CourseModules2Copy = { ...DEFAULT_COPY, ...copyProp }
const uid = React.useId()
const headingId = uid + '-heading'
const hintId = uid + '-hint'
const statuses = modules.map(statusOf)
const currentIdx = statuses.indexOf('progress')
const firstNew = statuses.indexOf('new')
const [spot, setSpot] = React.useState(() => (currentIdx >= 0 ? currentIdx : Math.max(firstNew, 0)))
const [filter, setFilter] = React.useState<CourseModules2Filter>(initialFilter)
const [announce, setAnnounce] = React.useState('')
const picked = React.useRef(false)
const cardRef = React.useRef<HTMLDivElement>(null)
const titleRef = React.useRef<HTMLHeadingElement>(null)
const n = modules.length
const shown = n ? Math.min(Math.max(spot, 0), n - 1) : -1
const m = shown >= 0 ? modules[shown] : undefined
React.useEffect(() => {
if (!picked.current) return
picked.current = false
const reduce = typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches
titleRef.current?.focus({ preventScroll: true })
cardRef.current?.scrollIntoView({ block: 'nearest', behavior: reduce ? 'auto' : 'smooth' })
}, [shown])
const pick = (i: number) => {
const target = modules[i]
if (!target) return
picked.current = true
setSpot(i)
setAnnounce(fill(copy.live, { n: i + 1, title: target.title }))
onSelect?.(target, i)
}
const matches = (i: number) =>
filter === 'all' || (filter === 'progress' ? statuses[i] === 'progress' : statuses[i] === 'new' || statuses[i] === 'locked')
const matched = modules.map((_, i) => i).filter(matches)
const shelf = matched.filter((i) => i !== shown)
const counts: Record<CourseModules2Filter, number> = {
all: n,
progress: statuses.filter((s) => s === 'progress').length,
new: statuses.filter((s) => s === 'new' || s === 'locked').length,
}
const filterLabel: Record<CourseModules2Filter, string> = {
all: copy.filterAll,
progress: copy.filterProgress,
new: copy.filterNew,
}
const totalLessons = modules.reduce((sum, mod) => sum + Math.max(mod.lessons, 0), 0)
const totalDone = modules.reduce((sum, mod) => sum + doneOf(mod), 0)
const overallPct = totalLessons ? Math.round((totalDone / totalLessons) * 100) : 0
const renderSpot = () => {
if (!m) return null
const st = statuses[shown]
const total = Math.max(m.lessons, 0)
const done = st === 'complete' ? total : doneOf(m)
const pct = st === 'complete' ? 100 : total ? Math.round((done / total) * 100) : 0
const number = m.nextLesson?.number ?? Math.min(done + 1, Math.max(total, 1))
const label =
st === 'progress'
? fill(copy.resume, { number })
: st === 'new'
? fill(copy.start, { number })
: st === 'complete'
? copy.review
: m.unlocksOn
? fill(copy.opensButton, { date: m.unlocksOn })
: copy.lockedButton
const instruction =
st === 'progress' ? copy.instructionResume : st === 'new' ? copy.instructionStart : st === 'complete' ? copy.instructionReview : ''
const disabled = st === 'locked' || state === 'disabled'
const dest = m.href ?? href
const showBack = currentIdx >= 0 && currentIdx !== shown
const btnClass = 'btn' + (state === 'hover' ? ' is-hover' : '') + (state === 'active' ? ' is-active' : '')
return (
<div ref={cardRef} className='spot'>
<div key={'cover' + shown} className={'sp-cover' + (st === 'locked' ? ' is-locked' : '')}>
<Cover module={m} alt={m.imageAlt ?? ''} eager />
</div>
<div key={'head' + shown} className='sp-head'>
<div className='sp-meta'>
<span>{fill(copy.moduleLabel, { n: shown + 1 })}</span>
<span aria-hidden='true'>·</span>
<span>{fill(total === 1 ? copy.lessonsCountOne : copy.lessonsCount, { total })}</span>
<StatusChip status={st} copy={copy} />
</div>
<h3 ref={titleRef} tabIndex={-1} className='sp-title'>
{m.title}
</h3>
</div>
<div key={'body' + shown} className='sp-body'>
{m.summary ? <p className='sp-summary'>{m.summary}</p> : null}
{st === 'locked' ? (
<div className='well'>
<span className='w-label'>
<Lock className='ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.statusLocked}
</span>
<span className='w-title'>{m.unlocksOn ? fill(copy.opensOn, { date: m.unlocksOn }) : copy.lockedSoon}</span>
</div>
) : st === 'complete' ? (
<div className='well'>
<span className='w-note'>
<span className='badge' aria-hidden='true'>
<Check size={12} strokeWidth={3} />
</span>
{copy.completeNote}
</span>
</div>
) : m.nextLesson ? (
<div className='well'>
<span className='w-label'>{fill(st === 'progress' ? copy.upNext : copy.firstUp, { number: m.nextLesson.number })}</span>
<span className='w-title'>{m.nextLesson.title}</span>
{m.nextLesson.duration ? (
<span className='w-meta'>
<Clock className='ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{m.nextLesson.duration}
</span>
) : null}
</div>
) : null}
{st !== 'locked' ? (
<div className='prog'>
<div className='prog-row'>
<span>{fill(copy.lessonsDone, { done, total })}</span>
<span className='prog-num'>{fill(copy.percent, { percent: pct })}</span>
</div>
<div className='track' role='progressbar' aria-label={copy.progressLabel} aria-valuemin={0} aria-valuemax={100} aria-valuenow={pct}>
<span className={st === 'complete' ? 'fill done' : 'fill'} style={{ width: pct + '%' }} />
</div>
</div>
) : null}
<div className='sp-cta'>
{instruction ? <p className='sp-instruction'>{fill(instruction, { number })}</p> : null}
<div className='sp-actions'>
{dest && !disabled ? (
<a className={btnClass} href={dest} onClick={() => onAction?.(m, shown)}>
{label}
</a>
) : (
<button type='button' className={btnClass} disabled={disabled} onClick={() => onAction?.(m, shown)}>
{label}
</button>
)}
{showBack ? (
<button type='button' className='btn-2' onClick={() => pick(currentIdx)}>
{fill(copy.backToCurrent, { n: currentIdx + 1 })}
</button>
) : null}
</div>
</div>
</div>
</div>
)
}
return (
<section className={['cf-course-modules-2', className].filter(Boolean).join(' ')} style={FX_HOST} aria-labelledby={headingId}>
<style>{CSS}</style>
<Glow />
<div className='inner'>
<header className='head'>
<div className='head-copy'>
<h2 id={headingId} className='h2'>
{headline}
</h2>
{lead ? <p className='lead'>{lead}</p> : null}
</div>
{totalLessons > 0 ? (
<p className='overall'>
<span className='ov-num'>{fill(copy.percent, { percent: overallPct })}</span>
<span className='ov-text'>{fill(copy.overall, { done: totalDone, total: totalLessons })}</span>
</p>
) : null}
</header>
{renderSpot()}
<div className='shelf-wrap'>
<div className='chips' role='group' aria-label={copy.filterGroup}>
{FILTERS.map((key) => (
<button key={key} type='button' className='chip' aria-pressed={filter === key} onClick={() => setFilter(key)}>
{filterLabel[key]}
<span className='count'>{counts[key]}</span>
</button>
))}
</div>
<span id={hintId} className='sr'>
{copy.pickHint}
</span>
{shelf.length ? (
<ul key={filter} className='shelf' aria-label={copy.shelfLabel}>
{shelf.map((i, k) => {
const mod = modules[i]
const st = statuses[i]
const total = Math.max(mod.lessons, 0)
const done = st === 'complete' ? total : doneOf(mod)
const pct = st === 'complete' ? 100 : st === 'progress' && total ? Math.round((done / total) * 100) : 0
return (
<li key={i} className='shelf-item' style={{ '--i': k } as React.CSSProperties}>
<button type='button' className={'cover' + (st === 'locked' ? ' is-locked' : '')} aria-describedby={hintId} onClick={() => pick(i)}>
<span className='art'>
<Cover module={mod} alt='' />
</span>
<span className='c-num'>{fill(copy.moduleLabel, { n: i + 1 })}</span>
<span className='c-title'>{mod.title}</span>
<span className='c-meta'>
{st === 'locked' ? (
<>
<Lock className='ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{mod.unlocksOn ? fill(copy.opensOn, { date: mod.unlocksOn }) : copy.lockedSoon}
</>
) : st === 'complete' ? (
<>
<Check className='ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.statusComplete}
</>
) : st === 'progress' ? (
fill(copy.shelfLessons, { done, total })
) : (
fill(total === 1 ? copy.lessonsCountOne : copy.lessonsCount, { total })
)}
</span>
<span className='c-line' aria-hidden='true'>
<span style={{ width: pct + '%' }} />
</span>
</button>
</li>
)
})}
</ul>
) : (
<div className='empty' role='status'>
<span className='empty-icon' aria-hidden='true'>
<Inbox size={20} strokeWidth={2.5} />
</span>
<p>{matched.length ? copy.emptySpotlit : copy.emptyNone}</p>
{filter !== 'all' ? (
<button type='button' className='btn-2 sm' onClick={() => setFilter('all')}>
{copy.showAll}
</button>
) : null}
</div>
)}
</div>
<p className='sr' aria-live='polite'>
{announce}
</p>
</div>
</section>
)
}
export default CourseModules2
function Cover({ module, alt, eager }: { module: CourseModules2Module; alt: string; eager?: boolean }) {
if (!module.image) {
return (
<span className='fallback'>
<Spot src={book} size={72} />
</span>
)
}
return (
<img
src={module.image}
alt={alt}
loading={eager ? 'eager' : 'lazy'}
decoding='async'
style={
{
objectPosition: module.imagePosition ?? 'center',
transformOrigin: module.imagePosition ?? 'center',
'--cm2-zoom': module.imageZoom && module.imageZoom > 0 ? module.imageZoom : 1,
} as React.CSSProperties
}
/>
)
}
function StatusChip({ status, copy }: { status: Status; copy: CourseModules2Copy }) {
if (status === 'complete') {
return (
<span className='st'>
<span className='badge' aria-hidden='true'>
<Check size={12} strokeWidth={3} />
</span>
{copy.statusComplete}
</span>
)
}
if (status === 'locked') {
return (
<span className='st'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.statusLocked}
</span>
)
}
return (
<span className={'st st-' + status}>
<span className='st-dot' aria-hidden='true' />
{status === 'progress' ? copy.statusProgress : copy.statusNew}
</span>
)
}
function doneOf(m: CourseModules2Module) {
return Math.min(Math.max(m.done ?? 0, 0), Math.max(m.lessons, 0))
}
function statusOf(m: CourseModules2Module): Status {
if (m.locked) return 'locked'
const done = doneOf(m)
if (m.lessons > 0 && done >= m.lessons) return 'complete'
if (done > 0) return 'progress'
return 'new'
}
function fill(template: string, vars: Record<string, string | number>) {
let out = template
for (const key of Object.keys(vars)) out = out.split('{' + key + '}').join(String(vars[key]))
return out
}
const CSS = `
.cf-course-modules-2{--cm2-gutter:clamp(16px,5vw,48px);--cm2-shadow:var(--shadow, oklch(0.22 0.03 260));position:relative;isolation:isolate;overflow-x:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) var(--cm2-gutter) clamp(64px,8.5vw,120px)}
.cf-course-modules-2 *{box-sizing:border-box}
.cf-course-modules-2 .inner{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-course-modules-2 .sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-course-modules-2 .head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:24px 48px;margin-bottom:clamp(32px,4vw,48px)}
.cf-course-modules-2 .head-copy{flex:1 1 30rem;min-width:0;max-width:46rem}
.cf-course-modules-2 .h2{margin:0;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(--band-ink)}
.cf-course-modules-2 .lead{margin:16px 0 0;max-width:62ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;color:color-mix(in oklch,var(--band-ink) 88%,var(--band))}
.cf-course-modules-2 .overall{margin:0;display:flex;align-items:center;gap:16px;flex:0 0 auto}
.cf-course-modules-2 .ov-num{font-family:var(--font-display);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-weight:800;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--band-ink)}
.cf-course-modules-2 .ov-text{max-width:12rem;font-size:0.9375rem;line-height:1.4;font-weight:600;text-wrap:balance;color:color-mix(in oklch,var(--band-ink) 88%,var(--band))}
.cf-course-modules-2 .spot{display:grid;grid-template-columns:minmax(220px,340px) minmax(0,1fr);grid-template-rows:auto 1fr;grid-template-areas:'cover head' 'cover body';gap:20px clamp(24px,4vw,48px);padding:clamp(20px,3vw,32px);background:var(--card);color:var(--ink);border:1px solid var(--card-border,color-mix(in oklch,var(--accent) 26%,var(--card)));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--cm2-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--cm2-shadow) l c h / .32)));scroll-margin:24px}
.cf-course-modules-2 .sp-cover{grid-area:cover;align-self:start;position:relative;aspect-ratio:3/4;border-radius:12px;overflow:hidden;background:color-mix(in oklch,var(--ink) 6%,var(--card));animation:cf-cm2-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-course-modules-2 .sp-cover img,.cf-course-modules-2 .art img{display:block;width:100%;height:100%;object-fit:cover;transform:scale(var(--cm2-zoom,1));transition:transform .3s cubic-bezier(.2,.7,.2,1),filter .16s ease}
.cf-course-modules-2 .sp-cover.is-locked img,.cf-course-modules-2 .cover.is-locked .art img{filter:grayscale(.8) brightness(.74)}
.cf-course-modules-2 .fallback{display:grid;place-items:center;width:100%;height:100%}
.cf-course-modules-2 .sp-head{grid-area:head;align-self:start;min-width:0;animation:cf-cm2-rise .45s .07s cubic-bezier(.2,.7,.2,1) both}
.cf-course-modules-2 .sp-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin:0 0 12px;font-size:0.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-course-modules-2 .st{display:inline-flex;align-items:center;gap:8px;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:0.875rem;line-height:1.2;font-weight:800;white-space:nowrap}
.cf-course-modules-2 .st-dot{width:8px;height:8px;border-radius:999px;background:var(--accent-fill,var(--accent))}
.cf-course-modules-2 .st-new .st-dot{background:color-mix(in oklch,var(--ink) 35%,var(--card))}
.cf-course-modules-2 .badge{display:inline-grid;place-items:center;flex:none;width:18px;height:18px;border-radius:999px;background:var(--success);color:var(--cm2-badge-ink,#fff)}
.cf-course-modules-2 .w-note .badge{vertical-align:-0.2em;margin-inline-end:.5em}
.cf-course-modules-2 .sp-title{margin:0;font-family:var(--font-display);font-size:clamp(1.625rem,2.4vw,2.25rem);line-height:1.1;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.02em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink);outline:none}
.cf-course-modules-2 .sp-body{grid-area:body;display:grid;gap:20px;align-content:start;min-width:0;animation:cf-cm2-rise .45s .14s cubic-bezier(.2,.7,.2,1) both}
.cf-course-modules-2 .sp-summary{margin:0;max-width:60ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
.cf-course-modules-2 .well{display:grid;gap:6px;padding:16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-course-modules-2 .w-label{font-size:0.875rem;line-height:1.2;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.cf-course-modules-2 .w-title{font-family:var(--font-display);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.25;font-weight:800;color:var(--ink);text-wrap:balance}
.cf-course-modules-2 .w-meta{font-size:0.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-course-modules-2 .w-note{font-size:1.0625rem;line-height:1.5;font-weight:600;color:var(--ink);text-wrap:pretty}
.cf-course-modules-2 .ic{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em;flex:none}
.cf-course-modules-2 .prog-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:10px;font-size:0.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-course-modules-2 .prog-num{font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.cf-course-modules-2 .track{height:10px;border-radius:999px;background:color-mix(in oklch,var(--ink) 10%,var(--card));overflow:hidden}
.cf-course-modules-2 .fill{display:block;height:100%;border-radius:inherit;background:var(--accent-fill,var(--accent));transition:width .45s cubic-bezier(.2,.7,.2,1)}
.cf-course-modules-2 .fill.done{background:var(--success)}
.cf-course-modules-2 .sp-cta{display:grid;gap:12px}
.cf-course-modules-2 .sp-instruction{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-weight:600;color:var(--ink);text-wrap:pretty}
.cf-course-modules-2 .sp-actions{display:flex;flex-wrap:wrap;gap:12px}
.cf-course-modules-2 .btn{--cm2-bg:var(--button-bg,var(--cta));display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:64px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--cm2-bg) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-decoration:none;white-space:nowrap;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--cm2-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--cm2-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--cm2-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--cm2-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-course-modules-2 .btn:not(:disabled):hover,.cf-course-modules-2 .btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--cm2-bg) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--cm2-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--cm2-bg) calc(l - .18) c h),0 1px 2px oklch(from var(--cm2-shadow) l c h / .34),0 10px 18px -6px oklch(from var(--cm2-shadow) l c h / .52))}
.cf-course-modules-2 .btn:not(:disabled):active,.cf-course-modules-2 .btn.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--cm2-bg) calc(l - .05) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--cm2-bg) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--cm2-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--cm2-shadow) l c h / .3)}
.cf-course-modules-2 .btn:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink) 9%,var(--card));color:var(--muted);text-shadow:none;box-shadow:none}
.cf-course-modules-2 .btn-2{display:inline-flex;align-items:center;justify-content:center;min-height:64px;padding:0 28px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.0625rem,1.3vw,1.1875rem);line-height:1.15;white-space:nowrap;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:pointer;transition:transform .16s ease,background .16s ease}
.cf-course-modules-2 .btn-2:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h)}
.cf-course-modules-2 .btn-2:active{transform:translateY(1px)}
.cf-course-modules-2 .btn-2.sm{min-height:48px;padding:0 20px;font-size:1.0625rem}
.cf-course-modules-2 .btn:focus-visible,.cf-course-modules-2 .btn-2:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-course-modules-2 .empty .btn-2:focus-visible{outline-color:var(--band-ink)}
.cf-course-modules-2 .shelf-wrap{margin-top:clamp(40px,5vw,64px)}
.cf-course-modules-2 .chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}
.cf-course-modules-2 .chip{appearance:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 8px 0 16px;border-radius:999px;border:1px solid oklch(from var(--band-ink) l c h / .22);background:oklch(from var(--band-ink) l c h / .1);color:var(--band-ink);font-family:var(--button-font,var(--font-body));font-size:0.9375rem;line-height:1;font-weight:var(--button-weight,800);white-space:nowrap;cursor:pointer;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}
.cf-course-modules-2 .chip:hover{background:oklch(from var(--band-ink) l c h / .18)}
.cf-course-modules-2 .chip:active{transform:translateY(1px)}
.cf-course-modules-2 .chip[aria-pressed=true]{background:var(--band-ink);border-color:var(--band-ink);color:var(--band)}
.cf-course-modules-2 .chip:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-course-modules-2 .count{display:inline-grid;place-items:center;min-width:28px;height:28px;padding:0 8px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .16);font-size:0.875rem;font-variant-numeric:tabular-nums}
.cf-course-modules-2 .chip[aria-pressed=true] .count{background:oklch(from var(--band) l c h / .14)}
.cf-course-modules-2 .shelf{list-style:none;margin:0 -6px;padding:10px 6px 20px;display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 4 * 20px) / 5);gap:20px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scroll-padding-inline:6px;scrollbar-width:thin;scrollbar-color:oklch(from var(--band-ink) l c h / .35) transparent}
.cf-course-modules-2 .shelf-item{min-width:0;scroll-snap-align:start;animation:cf-cm2-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(min(var(--i,0),4) * .07s)}
.cf-course-modules-2 .cover{appearance:none;display:flex;flex-direction:column;align-items:stretch;width:100%;padding:0;border:0;border-radius:var(--button-radius,var(--radius,12px));background:none;color:var(--band-ink);font:inherit;text-align:left;cursor:pointer;outline:none}
.cf-course-modules-2 .art{position:relative;display:block;aspect-ratio:3/4;border-radius:12px;overflow:hidden;background:color-mix(in oklch,var(--ink) 6%,var(--card));filter:drop-shadow(0 2px 3px oklch(from var(--cm2-shadow) calc(l - .05) c h / .45)) drop-shadow(0 10px 14px oklch(from var(--cm2-shadow) calc(l - .05) c h / .3));transition:transform .16s ease}
.cf-course-modules-2 .cover:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-course-modules-2 .cover:active .art{transform:translateY(-1px)}
.cf-course-modules-2 .c-num{display:block;margin-top:14px;font-size:0.875rem;line-height:1.2;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:color-mix(in oklch,var(--band-ink) 80%,var(--band))}
.cf-course-modules-2 .c-title{display:block;min-height:calc(2em * 1.3);margin-top:6px;font-family:var(--font-display);font-size:1.0625rem;line-height:1.3;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.01em);color:var(--band-ink);text-wrap:balance}
.cf-course-modules-2 .c-meta{display:block;margin-top:6px;font-size:0.9375rem;line-height:1.4;font-weight:600;color:color-mix(in oklch,var(--band-ink) 84%,var(--band))}
.cf-course-modules-2 .c-line{display:block;margin-top:12px;height:4px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .18);overflow:hidden}
.cf-course-modules-2 .c-line>span{display:block;height:100%;border-radius:inherit;background:var(--band-ink)}
@media (hover:hover){.cf-course-modules-2 .cover:hover .art{transform:translateY(-4px)}.cf-course-modules-2 .cover:hover .art img{transform:scale(calc(var(--cm2-zoom,1) * 1.04))}}
.cf-course-modules-2 .empty{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:24px;border-radius:var(--radius,12px);background:oklch(from var(--band-ink) l c h / .08);border:1px solid oklch(from var(--band-ink) l c h / .16)}
.cf-course-modules-2 .empty-icon{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .14);color:var(--band-ink)}
.cf-course-modules-2 .empty p{margin:0;flex:1 1 16rem;font-size:1.0625rem;line-height:1.5;font-weight:600;color:var(--band-ink);text-wrap:pretty}
@keyframes cf-cm2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (max-width:1023px){
.cf-course-modules-2 .spot{grid-template-columns:minmax(0,240px) minmax(0,1fr)}
.cf-course-modules-2 .shelf{grid-auto-columns:calc((100% - 3 * 16px) / 3.4);gap:16px}
}
@media (max-width:639px){
.cf-course-modules-2 .spot{grid-template-columns:96px minmax(0,1fr);grid-template-rows:auto auto auto;grid-template-areas:'meta meta' 'cover title' 'body body';gap:16px;padding:20px}
.cf-course-modules-2 .sp-head{display:contents}
.cf-course-modules-2 .sp-meta{grid-area:meta;margin:0}
.cf-course-modules-2 .sp-title{grid-area:title;align-self:center;font-size:1.3125rem;line-height:1.15}
.cf-course-modules-2 .sp-body{margin-top:4px}
.cf-course-modules-2 .chips{flex-wrap:nowrap;overflow-x:auto;margin:-8px calc(-1 * var(--cm2-gutter)) 12px -8px;padding:8px var(--cm2-gutter) 8px 8px;scrollbar-width:none}
.cf-course-modules-2 .chips::-webkit-scrollbar{display:none}
.cf-course-modules-2 .chip{flex:none;gap:6px;padding:0 6px 0 14px;font-size:0.875rem}
.cf-course-modules-2 .count{min-width:26px;height:26px;padding:0 6px}
.cf-course-modules-2 .sp-actions{flex-direction:column}
.cf-course-modules-2 .sp-actions .btn,.cf-course-modules-2 .sp-actions .btn-2{width:100%}
.cf-course-modules-2 .overall{gap:12px}
.cf-course-modules-2 .shelf{margin-right:calc(-1 * var(--cm2-gutter));padding-right:var(--cm2-gutter);grid-auto-columns:calc((100% + var(--cm2-gutter) - 24px) / 2.3);gap:12px}
}
@media (prefers-reduced-motion:reduce){
.cf-course-modules-2 .sp-cover,.cf-course-modules-2 .sp-head,.cf-course-modules-2 .sp-body,.cf-course-modules-2 .shelf-item{animation:none}
.cf-course-modules-2 .btn,.cf-course-modules-2 .btn-2,.cf-course-modules-2 .chip,.cf-course-modules-2 .art,.cf-course-modules-2 .art img,.cf-course-modules-2 .sp-cover img,.cf-course-modules-2 .fill{transition:none}
.cf-course-modules-2 .cover:hover .art,.cf-course-modules-2 .cover:active .art{transform:none}
.cf-course-modules-2 .cover:hover .art img{transform:scale(var(--cm2-zoom,1))}
}
`
pieces/content/course-modules-2/specimen.tsx 87 lines
import __studioImagef43ecf08 from "../assets/f95cdd3cbffdbce5.webp";
import __studioImage849ba7bf from "../assets/739990d2ae60f9fa.webp";
import __studioImage99305847 from "../assets/b178ba620f92ec46.webp";
import * as React from 'react'
import { CourseModules2, type CourseModules2Props } from '../course-modules-2'
import { slot } from '../../slots'
const coversOpening = __studioImagef43ecf08
const coversProposal = __studioImage849ba7bf
const coversClose = __studioImage99305847
export const states = ['default', 'hover', 'active', 'disabled']
export default function CourseModules2Specimen({ state = 'default' }: { state?: CourseModules2Props['state'] }) {
return (
<CourseModules2
state={state}
headline='Your next lesson is one click away'
lead='Your Quotient Sales Academy place is saved. Pick up your discovery calls where you stopped, or choose any module on the shelf.'
modules={[
{
title: 'Find buyers who are ready to talk',
summary: 'Build a short list of accounts worth your week and reach them first.',
image: slot('item-1', coversOpening),
imageAlt: 'Clay compass on a folded map with pins marking chosen spots',
imagePosition: 'left center',
imageZoom: 1.08,
lessons: 5,
done: 5,
},
{
title: 'Run a discovery call they remember',
summary: 'Lead the first call with questions that surface the real problem and the budget behind it.',
image: slot('item-2', coversOpening),
imageAlt: 'Two coffee cups facing each other with a speech bubble between them',
imagePosition: 'right center',
imageZoom: 1.08,
lessons: 6,
done: 3,
nextLesson: { number: 4, title: 'Ask the question behind the question', duration: '14 min' },
},
{
title: 'Write a proposal they sign',
summary: 'Turn what you heard on the call into a one-page proposal built around their numbers.',
image: slot('item-3', coversProposal),
imageAlt: 'Closed proposal folder with a fountain pen on top',
imagePosition: 'left center',
imageZoom: 1.08,
lessons: 7,
nextLesson: { number: 1, title: 'Open with their numbers, not yours', duration: '11 min' },
},
{
title: 'Handle the price objection',
summary: 'Answer “it’s too expensive” calmly and keep the deal moving.',
image: slot('item-4', coversProposal),
imageAlt: 'Balance scale holding coins and a gift box, perfectly level',
imagePosition: 'right center',
imageZoom: 1.08,
lessons: 5,
nextLesson: { number: 1, title: 'Why “too expensive” rarely means price', duration: '9 min' },
},
{
title: 'Close without the hard sell',
summary: 'Ask for the decision in a way that feels like the natural next step.',
image: slot('item-5', coversClose),
imageAlt: 'Two clay hands meeting in a handshake',
imagePosition: 'left center',
imageZoom: 1.08,
lessons: 6,
locked: true,
unlocksOn: 'Dec 4',
},
{
title: 'Grow the account after the sale',
summary: 'Turn one signed deal into the next conversation with the same buyer.',
image: slot('item-6', coversClose),
imageAlt: 'Potted plant growing taller across three steps',
imagePosition: 'right center',
imageZoom: 1.08,
lessons: 5,
locked: true,
unlocksOn: 'Dec 11',
},
]}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalCourseModules2 |
React.ReactNode |
|
lead OptionalCourseModules2 |
React.ReactNode |
|
modules OptionalCourseModules2 |
CourseModules2Module[] |
|
copy OptionalCourseModules2 |
Partial<CourseModules2Copy> |
|
initialFilter OptionalCourseModules2 |
CourseModules2Filter |
|
href OptionalCourseModules2 |
string |
|
onAction OptionalCourseModules2 |
(module: CourseModules2Module, index: number) => void |
|
onSelect OptionalCourseModules2 |
(module: CourseModules2Module, index: number) => void |
|
state OptionalCourseModules2 |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalCourseModules2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-4- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-5- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-6- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
739990d2ae60f9fa.webp
image/webp · 47 KB
-
b178ba620f92ec46.webp
image/webp · 37 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
f95cdd3cbffdbce5.webp
image/webp · 52.2 KB