Membership Preview 2
The library shelf: one module sits in the spotlight with its cover, promise and lesson count, the rest wait on a
Use it in a prompt
Use content/membership-preview-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/membership-preview-2.tsx. - Import it and pass your copy and images (Props tab):
import { MembershipPreview2 } from "@/components/funneldna/content/membership-preview-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/membership-preview-2/component.tsx 539 lines
// layout: spotlight-row
// The library shelf: one module sits in the spotlight with its cover, promise and lesson count, the rest wait on a
// shelf the visitor browses like a member, and the one action stays fixed under the spotlight.
import * as React from 'react'
import { Layers, MousePointerClick, ShieldCheck } from 'lucide-react'
import { FX_HOST, Spot, Texture } from '../fx/fx'
import linen from '../fx/textures/linen'
import book from '../fx/spots/book'
export type ShelfModule = {
/** Module name, shown under its shelf cover and as the spotlight title. */
title: string
/** Short promise (about two lines) shown in the spotlight. */
promise?: string
/** Lesson count; the count renders only when set. */
lessons?: number
/** Slot image (item-n): the module's cover art. */
image?: string
/** Alt text for the spotlight cover; falls back to the title. */
imageAlt?: string
/** CSS object-position for the cover crop, e.g. '0% 50%'. */
imagePosition?: string
}
export type MembershipPreview2Copy = {
/** Count line for several lessons. Uses {count}. */
lessons: string
/** Count line for one lesson. Uses {count}. */
lesson: string
/** Position line in the spotlight. Uses {n} and {total}. */
moduleOf: string
/** Accessible label for the shelf of covers. */
shelfLabel: string
/** Accessible label for the spotlight region. */
spotlightLabel: string
}
export type MembershipPreview2Props = {
headline?: string
/** Phrase inside the headline that gets one marker stroke. */
highlight?: string
subheadline?: string
/** The modules, in shelf order. */
modules?: ShelfModule[]
/** Module shown in the spotlight first (0-based). */
initialIndex?: number
/** Short instruction above the shelf. */
shelfHint?: string
/** Price beside the button; renders only when set. */
price?: string
/** Quiet line under the price. */
priceNote?: string
/** Guarantee line under the action; renders only when set. */
guarantee?: string
/** Button action line. */
label?: string
/** Benefit line inside the button, under the label. */
sublabel?: string
/** Navigation destination for the button. */
href?: string
/** Called on a button click (not while disabled). */
onAction?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void
disabled?: boolean
/** Forces a button state for previews. */
state?: 'default' | 'hover' | 'active' | 'disabled'
/** Generated labels; partial overrides merge with the defaults. */
copy?: Partial<MembershipPreview2Copy>
className?: string
}
export function MembershipPreview2(props: MembershipPreview2Props) {
const {
headline = 'Look inside before you join',
highlight = 'Look inside',
subheadline = 'Every module is on the shelf. Open any one and see exactly what you’ll learn.',
modules = DEFAULT_MODULES,
initialIndex = 0,
shelfHint = 'Tap a cover to open it',
price,
priceNote,
guarantee,
label = 'Get Instant Access',
sublabel = 'Start your first lesson today',
href,
onAction,
disabled,
state = 'default',
className,
} = props
const copy: MembershipPreview2Copy = { ...DEFAULT_COPY, ...props.copy }
const uid = React.useId()
const total = modules.length
const [active, setActive] = React.useState(initialIndex)
const buttons = React.useRef<Array<HTMLButtonElement | null>>([])
if (!total) return null
const index = Math.min(Math.max(active, 0), total - 1)
const current = modules[index]
const spotId = uid + '-spot'
const isDisabled = Boolean(disabled) || state === 'disabled'
const btnClass = cx('mp2-btn', state === 'hover' && 'is-hover', state === 'active' && 'is-active')
const countFor = (m: ShelfModule) =>
m.lessons == null ? '' : fill(m.lessons === 1 ? copy.lesson : copy.lessons, { count: String(m.lessons) })
const currentCount = countFor(current)
const handleClick = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {
if (isDisabled) {
event.preventDefault()
return
}
onAction?.(event)
}
const onShelfKey = (event: React.KeyboardEvent<HTMLDivElement>) => {
if (!['ArrowRight', 'ArrowLeft', 'Home', 'End'].includes(event.key)) return
const from = (event.target as HTMLElement).closest('[data-index]')
if (!from) return
const i = Number(from.getAttribute('data-index'))
event.preventDefault()
const next =
event.key === 'Home' ? 0 : event.key === 'End' ? total - 1 : event.key === 'ArrowRight' ? Math.min(total - 1, i + 1) : Math.max(0, i - 1)
buttons.current[next]?.focus()
}
const inner = (
<>
<span className='mp2-btn-label'>{label}</span>
{sublabel ? <span className='mp2-btn-sub'>{sublabel}</span> : null}
</>
)
return (
<section className={cx('cf-membership-preview-2', className)} style={FX_HOST} aria-labelledby={uid + '-title'}>
<style>{CSS}</style>
<Texture src={linen} tone='ink' />
<div className='mp2-wrap'>
<header className='mp2-head'>
<h2 id={uid + '-title'} className='mp2-title'>{withMarker(headline, highlight)}</h2>
{subheadline ? <p className='mp2-lead'>{subheadline}</p> : null}
</header>
<div className='mp2-stage' id={spotId} role='region' aria-label={copy.spotlightLabel}>
<div className='mp2-cover'>
{modules.map((m, i) =>
m.image ? (
<img
key={m.title + i}
className={cx('mp2-cover-img', i === index && 'is-on')}
src={m.image}
alt={i === index ? m.imageAlt ?? m.title : ''}
aria-hidden={i === index ? undefined : true}
style={m.imagePosition ? { objectPosition: m.imagePosition } : undefined}
loading={i === index ? 'eager' : 'lazy'}
decoding='async'
/>
) : (
<span key={m.title + i} className={cx('mp2-cover-fallback', i === index && 'is-on')} aria-hidden='true'>
<Spot src={book} size={112} />
</span>
),
)}
</div>
<div className='mp2-info'>
<div aria-live='polite'>
<div key={index} className='mp2-copy-in'>
<h3 className='mp2-module-title'>{current.title}</h3>
{current.promise ? <p className='mp2-promise'>{current.promise}</p> : null}
<p className='mp2-meta'>
{currentCount ? (
<span className='mp2-chip'>
<Layers size={16} strokeWidth={2.5} aria-hidden='true' />
{currentCount}
</span>
) : null}
<span className='mp2-step'>{fill(copy.moduleOf, { n: String(index + 1), total: String(total) })}</span>
</p>
</div>
</div>
<div className='mp2-action'>
<div className='mp2-action-row'>
{price ? (
<p className='mp2-price'>
<span className='mp2-price-num'>{price}</span>
{priceNote ? <span className='mp2-price-note'>{priceNote}</span> : null}
</p>
) : null}
{href && !isDisabled ? (
<a className={btnClass} href={href} onClick={handleClick}>
{inner}
</a>
) : (
<button type='button' className={btnClass} onClick={handleClick} disabled={isDisabled}>
{inner}
</button>
)}
</div>
{guarantee ? (
<p className='mp2-guarantee'>
<ShieldCheck size={18} strokeWidth={2.5} aria-hidden='true' />
{guarantee}
</p>
) : null}
</div>
</div>
</div>
{total > 1 ? (
<>
{shelfHint ? (
<p className='mp2-hint'>
<MousePointerClick size={16} strokeWidth={2.5} aria-hidden='true' />
{shelfHint}
</p>
) : null}
<div className='mp2-shelf' role='group' aria-label={copy.shelfLabel} onKeyDown={onShelfKey}>
<div className='mp2-track'>
{modules.map((m, i) => {
const count = countFor(m)
return (
<button
key={m.title + i}
ref={(el) => {
buttons.current[i] = el
}}
type='button'
data-index={i}
className={cx('mp2-item', i === index && 'is-selected')}
aria-pressed={i === index}
aria-controls={spotId}
onClick={() => setActive(i)}
onFocus={() => setActive(i)}
onPointerEnter={(event) => {
if (event.pointerType === 'mouse') setActive(i)
}}
>
<span className='mp2-item-cover'>
{m.image ? (
<img
src={m.image}
alt=''
style={m.imagePosition ? { objectPosition: m.imagePosition } : undefined}
loading='lazy'
decoding='async'
/>
) : (
<span className='mp2-item-spot' aria-hidden='true'>
<Spot src={book} size={64} />
</span>
)}
</span>
<span className='mp2-item-title'>{m.title}</span>
{count ? <span className='mp2-item-count'>{count}</span> : null}
</button>
)
})}
</div>
</div>
</>
) : null}
</div>
</section>
)
}
export default MembershipPreview2
const DEFAULT_COPY: MembershipPreview2Copy = {
lessons: '{count} lessons',
lesson: '{count} lesson',
moduleOf: 'Module {n} of {total}',
shelfLabel: 'Modules in the library',
spotlightLabel: 'Module preview',
}
const DEFAULT_MODULES: ShelfModule[] = [
{ title: 'Start here', promise: 'Get set up and finish your first lesson in one sitting.' },
{ title: 'The core method', promise: 'Learn the one process every later lesson builds on.' },
{ title: 'Put it to work', promise: 'Apply the method step by step on a real project of your own.' },
{ title: 'Go further', promise: 'Add the finishing moves once the basics feel easy.' },
]
function withMarker(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='mp2-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
function fill(template: string, values: Record<string, string>) {
return Object.keys(values).reduce((out, key) => out.split('{' + key + '}').join(values[key]), template)
}
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ')
}
const CSS = `
.cf-membership-preview-2 {
--mp2-gutter: clamp(16px, 5vw, 48px);
--mp2-cover-w: 168px;
--mp2-gap: 24px;
--mp2-shadow: var(--shadow, oklch(0.22 0.03 260));
--mp2-marker: var(--marker, #fae37c);
position: relative;
overflow-x: clip;
background: var(--surface);
color: var(--ink);
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) var(--mp2-gutter) clamp(64px, 8.5vw, 120px);
}
.cf-membership-preview-2 *, .cf-membership-preview-2 *::before, .cf-membership-preview-2 *::after { box-sizing: border-box; }
.cf-membership-preview-2 .mp2-wrap { position: relative; z-index: 1; max-width: 1120px; margin-inline: auto; }
.cf-membership-preview-2 .mp2-head { max-width: 46rem; margin: 0 auto clamp(32px, 4vw, 48px); text-align: center; }
.cf-membership-preview-2 .mp2-title {
margin: 0 0 16px;
font-family: var(--font-display);
font-size: clamp(2rem, 3.6vw, 3.25rem);
line-height: 1.06;
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.025em);
text-transform: var(--display-case, none);
text-wrap: balance;
color: var(--ink);
}
.cf-membership-preview-2 .mp2-mark {
background-image: linear-gradient(transparent 56%, color-mix(in oklch, var(--mp2-marker) 88%, transparent) 56%, color-mix(in oklch, var(--mp2-marker) 88%, transparent) 94%, transparent 94%);
padding-inline: 0.06em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.cf-membership-preview-2 .mp2-lead { margin: 0; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.cf-membership-preview-2 .mp2-stage {
position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: clamp(24px, 4vw, 56px);
padding: clamp(20px, 3.5vw, 48px);
border-radius: var(--card-radius, var(--radius, 14px));
background: var(--band);
color: var(--band-ink);
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--mp2-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--mp2-shadow) l c h / 0.32)));
}
.cf-membership-preview-2 .mp2-cover { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: oklch(from var(--band-ink) l c h / 0.08); }
.cf-membership-preview-2 .mp2-cover-img, .cf-membership-preview-2 .mp2-cover-fallback {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
opacity: 0;
transform: scale(1.04);
transition: opacity 0.45s cubic-bezier(.2,.7,.2,1), transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.cf-membership-preview-2 .mp2-cover-img { display: block; object-fit: cover; object-position: center; }
.cf-membership-preview-2 .mp2-cover-fallback { display: grid; place-items: center; }
.cf-membership-preview-2 .mp2-cover .is-on { opacity: 1; transform: none; }
.cf-membership-preview-2 .mp2-info { display: flex; flex-direction: column; min-width: 0; }
.cf-membership-preview-2 .mp2-copy-in { animation: mp2-in 0.45s cubic-bezier(.2,.7,.2,1) both; }
.cf-membership-preview-2 .mp2-module-title {
margin: 0;
font-family: var(--font-display);
font-size: clamp(1.75rem, 2.8vw, 2.375rem);
line-height: 1.08;
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-membership-preview-2 .mp2-promise { max-width: 40ch; margin: 16px 0 0; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--band-ink); text-wrap: pretty; }
.cf-membership-preview-2 .mp2-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 24px 0 0; }
.cf-membership-preview-2 .mp2-chip {
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 32px;
padding: 4px 12px;
border-radius: 999px;
background: oklch(from var(--band-ink) l c h / 0.12);
color: var(--band-ink);
font-size: 0.875rem;
font-weight: 800;
line-height: 1.2;
}
.cf-membership-preview-2 .mp2-step { font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--band-ink); }
.cf-membership-preview-2 .mp2-action { margin-top: auto; padding-top: 32px; }
.cf-membership-preview-2 .mp2-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.cf-membership-preview-2 .mp2-price { display: grid; gap: 12px; margin: 0; }
.cf-membership-preview-2 .mp2-price-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-membership-preview-2 .mp2-price-note { font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--band-ink); }
.cf-membership-preview-2 .mp2-btn {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
min-height: 72px;
min-width: min(100%, 280px);
margin: 0;
padding: 10px 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));
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);
text-align: center;
text-decoration: none;
text-shadow: var(--button-text-shadow, none);
cursor: pointer;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--mp2-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--mp2-shadow) l c h / 0.45));
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-membership-preview-2 .mp2-btn-label { font-size: clamp(1.125rem, 1.55vw, 1.375rem); line-height: 1.15; text-wrap: balance; }
.cf-membership-preview-2 .mp2-btn-sub { font-family: var(--font-body); font-size: 0.9375rem; line-height: 1.3; font-weight: 600; text-wrap: pretty; }
.cf-membership-preview-2 .mp2-btn:hover:not(:disabled), .cf-membership-preview-2 .mp2-btn.is-hover {
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h));
transform: translateY(-1px);
box-shadow: inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--mp2-shadow) l c h / 0.34), 0 10px 18px -6px oklch(from var(--mp2-shadow) l c h / 0.55);
}
.cf-membership-preview-2 .mp2-btn:active:not(:disabled), .cf-membership-preview-2 .mp2-btn.is-active {
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.06) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.08) c h));
transform: translateY(1px);
box-shadow: inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - 0.22) c h / 0.5), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--mp2-shadow) l c h / 0.3);
}
.cf-membership-preview-2 .mp2-btn:focus-visible { outline: 3px solid var(--band-ink); outline-offset: 3px; }
.cf-membership-preview-2 .mp2-btn:disabled {
background: var(--secondary);
color: var(--secondary-ink);
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--shadow-sm));
cursor: not-allowed;
transform: none;
}
.cf-membership-preview-2 .mp2-guarantee { margin: 16px 0 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--band-ink); text-wrap: pretty; }
.cf-membership-preview-2 .mp2-guarantee svg, .cf-membership-preview-2 .mp2-hint svg { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-membership-preview-2 .mp2-hint { margin: clamp(32px, 4vw, 48px) 0 4px; text-align: center; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted); text-wrap: pretty; }
.cf-membership-preview-2 .mp2-shelf {
overflow-x: auto;
overflow-y: hidden;
margin-inline: calc(-1 * var(--mp2-gutter));
padding-inline: var(--mp2-gutter);
scroll-padding-inline: var(--mp2-gutter);
scroll-snap-type: x proximity;
overscroll-behavior-x: contain;
scrollbar-width: thin;
scrollbar-color: oklch(from var(--ink) l c h / 0.25) transparent;
}
.cf-membership-preview-2 .mp2-track { position: relative; display: flex; gap: var(--mp2-gap); width: max-content; margin-inline: auto; padding: 20px 12px 16px; }
.cf-membership-preview-2 .mp2-track::before {
content: '';
position: absolute;
left: 0;
right: 0;
top: calc(20px + var(--mp2-cover-w) * 1.25);
height: 12px;
border-radius: 6px;
background: color-mix(in oklch, var(--ink) 9%, var(--card));
box-shadow: inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6), 0 1px 2px oklch(from var(--mp2-shadow) l c h / 0.22), 0 6px 10px -4px oklch(from var(--mp2-shadow) l c h / 0.22);
}
.cf-membership-preview-2 .mp2-item {
position: relative;
z-index: 1;
display: flex;
flex: 0 0 auto;
flex-direction: column;
align-items: flex-start;
width: var(--mp2-cover-w);
margin: 0;
padding: 0;
border: 0;
border-radius: 12px;
background: none;
color: var(--ink);
font: inherit;
text-align: left;
cursor: pointer;
scroll-snap-align: start;
-webkit-tap-highlight-color: transparent;
}
.cf-membership-preview-2 .mp2-item-cover {
position: relative;
display: block;
width: 100%;
aspect-ratio: 4 / 5;
border-radius: 12px;
overflow: hidden;
background: color-mix(in oklch, var(--ink) 6%, var(--card));
outline: 3px solid transparent;
outline-offset: 3px;
filter: drop-shadow(0 2px 3px oklch(from var(--mp2-shadow) l c h / 0.28)) drop-shadow(0 10px 12px oklch(from var(--mp2-shadow) l c h / 0.2));
transition: transform 0.2s cubic-bezier(.2,.7,.2,1), outline-color 0.2s ease;
}
.cf-membership-preview-2 .mp2-item-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cf-membership-preview-2 .mp2-item-spot { display: grid; place-items: center; height: 100%; }
.cf-membership-preview-2 .mp2-item-title { display: block; margin-top: 24px; font-size: 1.0625rem; line-height: 1.25; font-weight: 700; color: var(--ink); text-wrap: balance; }
.cf-membership-preview-2 .mp2-item-count { display: block; margin-top: 4px; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted); }
.cf-membership-preview-2 .mp2-item.is-selected .mp2-item-cover { transform: translateY(-10px); outline-color: var(--accent-fill, var(--accent)); }
.cf-membership-preview-2 .mp2-item.is-selected .mp2-item-title { color: var(--accent); }
@media (hover: hover) {
.cf-membership-preview-2 .mp2-item:hover:not(.is-selected) .mp2-item-cover { transform: translateY(-6px); }
}
.cf-membership-preview-2 .mp2-item:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.9); outline-offset: 6px; }
@media (max-width: 899px) {
.cf-membership-preview-2 .mp2-stage { grid-template-columns: minmax(0, 1fr); }
.cf-membership-preview-2 .mp2-cover { aspect-ratio: 4 / 3; }
}
@media (max-width: 599px) {
.cf-membership-preview-2 { --mp2-cover-w: 128px; --mp2-gap: 16px; }
.cf-membership-preview-2 .mp2-action { padding-top: 28px; }
.cf-membership-preview-2 .mp2-action-row { flex-direction: column; align-items: stretch; }
.cf-membership-preview-2 .mp2-btn { width: 100%; padding-inline: 20px; }
}
@media (prefers-reduced-motion: reduce) {
.cf-membership-preview-2 .mp2-copy-in { animation: none; }
.cf-membership-preview-2 .mp2-cover-img, .cf-membership-preview-2 .mp2-cover-fallback { transition: none; transform: none; }
.cf-membership-preview-2 .mp2-item-cover, .cf-membership-preview-2 .mp2-btn { transition: none; }
.cf-membership-preview-2 .mp2-btn:hover:not(:disabled), .cf-membership-preview-2 .mp2-btn.is-hover, .cf-membership-preview-2 .mp2-btn:active:not(:disabled), .cf-membership-preview-2 .mp2-btn.is-active { transform: none; }
}
@keyframes mp2-in {
from { opacity: 0.82; transform: translateY(8px); }
to { opacity: 1; transform: none; }
}
`
pieces/content/membership-preview-2/specimen.tsx 68 lines
import __studioImage7259240f from "../assets/fa79b8eae02d498a.webp";
import __studioImage56d0eff1 from "../assets/bde2fd05600058b5.webp";
import __studioImage491f8790 from "../assets/8dd4932b5c75a364.webp";
import * as React from 'react'
import { MembershipPreview2, type ShelfModule } from '../membership-preview-2'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
const botanicalArt = __studioImage7259240f
const panoramaArt = __studioImage56d0eff1
const stillLifeArt = __studioImage491f8790
export const states = ['default', 'hover', 'active', 'disabled']
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled'
export default function MembershipPreview2Specimen({ state = 'default' }: { state?: SpecimenState }) {
const sample = defaults.sample
const modules: ShelfModule[] = [
{
title: 'Botanicals from life',
promise: 'Paint a stem, a leaf and a full bloom that look alive, not stiff. One plant per lesson, start to finish.',
lessons: 8,
image: slot('item-1', botanicalArt),
imageAlt: 'Loose watercolor painting of pink garden roses',
},
{
title: 'Wet-in-wet skies',
promise: 'Drop color into wet paper and let it bloom into sunrises, storms and soft morning light.',
lessons: 6,
image: slot('item-2', panoramaArt),
imageAlt: 'Watercolor sunrise sky glowing over calm water',
imagePosition: '0% 50%',
},
{
title: 'Landscapes in layers',
promise: 'Build hills, water and pines in three simple washes, so your scenes finally have depth.',
lessons: 10,
image: slot('item-3', panoramaArt),
imageAlt: 'Watercolor hills and pine trees painted in layered washes',
imagePosition: '100% 50%',
},
{
title: 'Still life and light',
promise: 'Make glass glow and fruit look round with one simple rule for where the light lands.',
lessons: 7,
image: slot('item-4', stillLifeArt),
imageAlt: 'Watercolor still life of a glass bottle, lemons and a pear',
},
]
return (
<MembershipPreview2
headline='Pull any lesson off the shelf and start painting tonight'
highlight='start painting tonight'
subheadline='Watercolor Weekly is a library you keep. Tap a cover to open a module, exactly as you will once you’re in.'
modules={modules}
shelfHint='Tap a cover to look inside'
price={sample.price}
priceNote={sample.note}
guarantee={sample.guarantee}
label='Join Watercolor Weekly'
sublabel='Paint your first lesson tonight'
href='#join'
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalMembershipPreview2 |
string |
|
highlight OptionalMembershipPreview2 |
string |
|
subheadline OptionalMembershipPreview2 |
string |
|
modules OptionalMembershipPreview2 |
ShelfModule[] |
|
initialIndex OptionalMembershipPreview2 |
number |
|
shelfHint OptionalMembershipPreview2 |
string |
|
price OptionalMembershipPreview2 |
string |
|
priceNote OptionalMembershipPreview2 |
string |
|
guarantee OptionalMembershipPreview2 |
string |
|
label OptionalMembershipPreview2 |
string |
|
sublabel OptionalMembershipPreview2 |
string |
|
href OptionalMembershipPreview2 |
string |
|
onAction OptionalMembershipPreview2 |
(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void |
|
disabled OptionalMembershipPreview2 |
boolean |
|
state OptionalMembershipPreview2 |
'default' | 'hover' | 'active' | 'disabled' |
|
copy OptionalMembershipPreview2 |
Partial<MembershipPreview2Copy> |
|
className OptionalMembershipPreview2 |
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-shadow- Secondary button.
--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.
--marker- The highlighter colour behind key phrases.
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.
-
2c539f422023a290.webp
image/webp · 115 KB
-
8dd4932b5c75a364.webp
image/webp · 55.4 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
bde2fd05600058b5.webp
image/webp · 84.2 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
fa79b8eae02d498a.webp
image/webp · 57 KB