Listing Showcase 3
Floor-plan face-off: two rental units side by side with generated plans. A toggle features one unit and walks every difference down a path that ends at its tour button, so a browser picks a plan and books the visit.
Use it in a prompt
Use offer/listing-showcase-3 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/offer/listing-showcase-3.tsx. - Import it and pass your copy and images (Props tab):
import { ListingShowcase3 } from "@/components/funneldna/offer/listing-showcase-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/listing-showcase-3/component.tsx 484 lines
// layout: path-to-action
// Floor-plan face-off: two rental units side by side with generated plans. A toggle features one unit and walks every difference down a path that ends at its tour button, so a browser picks a plan and books the visit.
import * as React from 'react';
import { CalendarDays, Check, DoorClosed, ListChecks, Ruler, Scissors, Shirt, Sun, Wallet, WashingMachine } from 'lucide-react';
import type { LucideIcon } from 'lucide-react';
import { FX_HOST, Pattern } from '../fx/fx';
export type FloorPlanUnit = {
/** Sent to onAction and added to href as ?unit=… */
id: string;
name: string;
/** Short line under the name, e.g. 'Corner unit · 6th floor'. */
tagline?: string;
/** Floor-plan illustration on a transparent background (slots: item-1, item-2). */
planImage?: string;
planAlt?: string;
rent: string;
/** Shown after the rent, e.g. '/mo'. */
rentUnit?: string;
size: string;
moveIn: string;
/** false when no unit of this plan is open: its tour buttons disable. */
available?: boolean;
/** A real leasing special for this plan, shown with a scissors mark. */
special?: string;
};
export type CompareIcon = 'size' | 'bedroom' | 'closet' | 'light' | 'laundry' | 'rent' | 'move-in' | 'other';
export type CompareRow = {
label: string;
icon?: CompareIcon;
/** One value per unit, in the order of units. Rows whose values differ are highlighted. */
values: [string, string];
};
export type ListingShowcase3Copy = {
toggleLegend: string;
featured: string;
rentLabel: string;
sizeLabel: string;
moveInLabel: string;
available: string;
unavailable: string;
primary: string;
quiet: string;
/** Band link to tour the other plan; {other} is replaced. */
other: string;
/** Closing instruction; {unit} is replaced by the featured unit's name. */
instruction: string;
/** Shown when the featured unit has no openings; {unit} and {other} are replaced. */
instructionUnavailable: string;
/** Table label; {a} and {b} are replaced by the unit names. */
tableLabel: string;
featureColumn: string;
legendDiff: string;
legendSame: string;
};
export type ListingShowcase3Props = {
/** Headline; a string headline can carry one emphasised phrase via emphasis. */
headline?: React.ReactNode;
/** Phrase inside a string headline, set in the accent colour. */
emphasis?: string;
lead?: React.ReactNode;
/** Italic aside in the leasing manager's voice. */
aside?: React.ReactNode;
/** Exactly two floor plans, compared side by side. */
units?: [FloorPlanUnit, FloorPlanUnit];
rows?: CompareRow[];
compareTitle?: React.ReactNode;
/** One short line under the closing button. */
note?: string;
/** Which unit starts featured (0 or 1). */
defaultFeatured?: 0 | 1;
copy?: Partial<ListingShowcase3Copy>;
/** Tour booking page; the chosen unit is sent as ?unit=… */
href?: string;
/** Called with the unit to tour when a tour button is pressed. */
onAction?: (detail: { unitId: string }) => void;
/** Called when the toggle features a different unit. */
onFeatureChange?: (unitId: string) => void;
/** Preview state; 'disabled' shows the featured unit with no openings. */
state?: 'default' | 'hover' | 'active' | 'disabled';
className?: string;
};
const DEFAULT_COPY: ListingShowcase3Copy = {
toggleLegend: 'Choose the floor plan to feature',
featured: 'Your pick',
rentLabel: 'Rent',
sizeLabel: 'Size',
moveInLabel: 'Move-in',
available: 'Available',
unavailable: 'No openings right now',
primary: 'Schedule a tour',
quiet: 'Tour this one instead',
other: 'Or tour {other} instead',
instruction: 'Click the button below to book your tour of {unit}.',
instructionUnavailable: '{unit} has no openings right now. Tour {other} instead.',
tableLabel: '{a} and {b}, compared',
featureColumn: 'Feature',
legendDiff: 'Changes between plans',
legendSame: 'Same in both',
};
const DEFAULT_UNITS: [FloorPlanUnit, FloorPlanUnit] = [
{ id: 'studio', name: 'The Studio', tagline: 'Open plan · 4th floor', rent: '$1,650', rentUnit: '/mo', size: '520 sq ft', moveIn: 'Dec 1', available: true },
{ id: 'one-bed', name: 'The One-Bed', tagline: 'Corner unit · 6th floor', rent: '$2,050', rentUnit: '/mo', size: '710 sq ft', moveIn: 'Jan 15', available: true },
];
const DEFAULT_ROWS: CompareRow[] = [
{ label: 'Living space', icon: 'size', values: ['520 sq ft', '710 sq ft'] },
{ label: 'Bedroom', icon: 'bedroom', values: ['Sleep nook, open plan', 'Separate room with a door'] },
{ label: 'Closet', icon: 'closet', values: ['Reach-in, 6 ft wide', 'Walk-in, 7 × 5 ft'] },
{ label: 'Natural light', icon: 'light', values: ['2 east-facing windows', '4 windows on two corner walls'] },
{ label: 'Laundry', icon: 'laundry', values: ['In-unit washer & dryer', 'In-unit washer & dryer'] },
{ label: 'Rent', icon: 'rent', values: ['$1,650 / mo', '$2,050 / mo'] },
{ label: 'Move-in', icon: 'move-in', values: ['Dec 1', 'Jan 15'] },
];
const ICONS: Record<CompareIcon, LucideIcon> = {
size: Ruler,
bedroom: DoorClosed,
closet: Shirt,
light: Sun,
laundry: WashingMachine,
rent: Wallet,
'move-in': CalendarDays,
other: ListChecks,
};
const PAIR = [0, 1] as const;
export function ListingShowcase3(props: ListingShowcase3Props) {
const {
headline = 'Studio or one-bed? Put them side by side',
emphasis = 'side by side',
lead = 'Two floor plans at The Marlowe Lofts, compared line by line. Pick the one that fits your life, then come stand in it.',
aside = '(I know. 190 square feet sounds small on paper. Then you open that walk-in closet.)',
units = DEFAULT_UNITS,
rows = DEFAULT_ROWS,
compareTitle = 'See every difference before you tour',
note = 'Tours take about 20 minutes · No application needed to visit',
defaultFeatured = 1,
href,
onAction,
onFeatureChange,
state = 'default',
className,
} = props;
const copy: ListingShowcase3Copy = { ...DEFAULT_COPY, ...(props.copy || {}) };
const uid = React.useId();
const [pick, setPick] = React.useState<0 | 1>(defaultFeatured);
const other: 0 | 1 = pick === 0 ? 1 : 0;
const force = state === 'hover' || state === 'active' ? state : undefined;
const isOpen = (i: 0 | 1) => units[i].available !== false && !(state === 'disabled' && i === pick);
const choose = (i: 0 | 1) => {
setPick(i);
if (onFeatureChange) onFeatureChange(units[i].id);
};
const act = (i: 0 | 1) => {
if (isOpen(i) && onAction) onAction({ unitId: units[i].id });
};
const tourHref = (i: 0 | 1) =>
href ? href + (href.indexOf('?') >= 0 ? '&' : '?') + 'unit=' + encodeURIComponent(units[i].id) : undefined;
const featuredOpen = isOpen(pick);
const otherOpen = isOpen(other);
return (
<section className={className ? 'cf-lsf ' + className : 'cf-lsf'} aria-labelledby={uid + '-h'}>
<style>{CSS}</style>
<div className='cf-lsf-top' style={FX_HOST}>
<Pattern name='grid' fade='edges' />
<div className='cf-lsf-wrap cf-lsf-head'>
<h2 id={uid + '-h'} className='cf-lsf-h2'>{emphasise(headline, emphasis)}</h2>
{lead ? <p className='cf-lsf-lead'>{lead}</p> : null}
{aside ? <p className='cf-lsf-aside'>{aside}</p> : null}
<fieldset className='cf-lsf-toggle'>
<legend className='cf-lsf-sr'>{copy.toggleLegend}</legend>
<span className='cf-lsf-thumb' data-pos={pick} aria-hidden='true' />
{PAIR.map((i) => (
<label key={units[i].id} className='cf-lsf-opt' data-on={pick === i}>
<input type='radio' name={uid + '-plan'} value={units[i].id} checked={pick === i} onChange={() => choose(i)} />
<span className='cf-lsf-optface'>
<span className='cf-lsf-optname'>{units[i].name}</span>
<span className='cf-lsf-optrent'>{units[i].rent}{units[i].rentUnit}</span>
</span>
</label>
))}
</fieldset>
</div>
</div>
<div className='cf-lsf-bottom'>
<div className='cf-lsf-wrap'>
<div className='cf-lsf-cards'>
{PAIR.map((i) => {
const u = units[i];
const on = pick === i;
const open = isOpen(i);
return (
<article key={u.id} className='cf-lsf-card' data-featured={on} aria-labelledby={uid + '-u' + i}>
<span className='cf-lsf-flag' aria-hidden={!on}>
<Check size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.featured}
</span>
<div className='cf-lsf-cardhead'>
<div>
<h3 id={uid + '-u' + i} className='cf-lsf-h3'>{u.name}</h3>
{u.tagline ? <p className='cf-lsf-tag'>{u.tagline}</p> : null}
</div>
<span className='cf-lsf-avail' data-open={open}>
<span className='cf-lsf-dot' aria-hidden='true' />
{open ? copy.available : copy.unavailable}
</span>
</div>
{u.planImage ? (
<figure className='cf-lsf-plan'>
<img src={u.planImage} alt={u.planAlt || ''} width={640} height={640} loading='lazy' decoding='async' />
</figure>
) : null}
<p className='cf-lsf-rent'>
<span className='cf-lsf-sr'>{copy.rentLabel}: </span>
<span className='cf-lsf-num'>{u.rent}</span>
{u.rentUnit ? <span className='cf-lsf-per'>{u.rentUnit}</span> : null}
</p>
<dl className='cf-lsf-facts'>
<div>
<dt>{copy.sizeLabel}</dt>
<dd>{u.size}</dd>
</div>
<div>
<dt>{copy.moveInLabel}</dt>
<dd>{u.moveIn}</dd>
</div>
</dl>
{u.special ? (
<p className='cf-lsf-special'>
<Scissors size={18} strokeWidth={2.5} aria-hidden='true' className='cf-lsf-inl' />
{u.special}
</p>
) : null}
<div className='cf-lsf-cardact'>
{on ? (
<TourButton label={open ? copy.primary : copy.unavailable} disabled={!open} href={tourHref(i)} force={force} onClick={() => act(i)} />
) : (
<button type='button' className='cf-lsf-quiet' disabled={!open} onClick={() => act(i)}>
{open ? copy.quiet : copy.unavailable}
</button>
)}
</div>
</article>
);
})}
</div>
<div className='cf-lsf-compare'>
<h3 className='cf-lsf-h2 cf-lsf-ctitle'>{compareTitle}</h3>
<p className='cf-lsf-legend'>
<span className='cf-lsf-legitem'>
<span className='cf-lsf-key' data-diff='true' aria-hidden='true' />
{copy.legendDiff}
</span>
<span className='cf-lsf-legitem'>
<span className='cf-lsf-key' aria-hidden='true' />
{copy.legendSame}
</span>
</p>
<div className='cf-lsf-path'>
<div role='table' className='cf-lsf-table' aria-label={fill(copy.tableLabel, { a: units[0].name, b: units[1].name })}>
<div role='row' className='cf-lsf-row cf-lsf-row--head'>
<span role='columnheader' className='cf-lsf-label cf-lsf-headlabel'>{copy.featureColumn}</span>
{PAIR.map((i) => (
<span key={units[i].id} role='columnheader' className='cf-lsf-colhead' data-feat={pick === i}>
{pick === i ? <Check size={16} strokeWidth={2.5} aria-hidden='true' /> : null}
{units[i].name}
</span>
))}
</div>
{rows.map((r, n) => {
const diff = r.values[0] !== r.values[1];
const Icon = ICONS[r.icon || 'other'];
const delay = { '--d': Math.min(n * 0.07, 0.28) + 's' } as React.CSSProperties;
return (
<div role='row' key={pick + '-' + n} className='cf-lsf-row cf-lsf-stop' data-diff={diff} style={delay}>
<span role='rowheader' className='cf-lsf-label'>
<Icon size={18} strokeWidth={2.5} aria-hidden='true' />
{r.label}
</span>
{PAIR.map((i) => (
<span key={i} role='cell' className='cf-lsf-cell'>
<span className='cf-lsf-val' data-feat={pick === i} data-diff={diff}>{r.values[i]}</span>
</span>
))}
</div>
);
})}
</div>
<div className='cf-lsf-stop cf-lsf-actionstop'>
<p className='cf-lsf-instr' aria-live='polite'>
{featuredOpen
? fill(copy.instruction, { unit: units[pick].name })
: fill(copy.instructionUnavailable, { unit: units[pick].name, other: units[other].name })}
</p>
<div className='cf-lsf-ctagroup'>
<TourButton
className='cf-lsf-btn--close'
label={featuredOpen ? copy.primary : copy.unavailable}
disabled={!featuredOpen}
href={tourHref(pick)}
force={force}
onClick={() => act(pick)}
/>
{note ? <p className='cf-lsf-note'>{note}</p> : null}
{otherOpen ? (
<button type='button' className='cf-lsf-quiet cf-lsf-quiet--band' onClick={() => act(other)}>
{fill(copy.other, { other: units[other].name })}
</button>
) : null}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
);
}
export default ListingShowcase3;
function TourButton(props: { label: string; disabled: boolean; href?: string; force?: string; className?: string; onClick: () => void }) {
const cls = props.className ? 'cf-lsf-btn ' + props.className : 'cf-lsf-btn';
if (props.href && !props.disabled) {
return (
<a className={cls} href={props.href} data-force={props.force} onClick={props.onClick}>
{props.label}
</a>
);
}
return (
<button type='button' className={cls} data-force={props.force} disabled={props.disabled} onClick={props.onClick}>
{props.label}
</button>
);
}
function fill(template: string, map: Record<string, string>) {
return Object.keys(map).reduce((s, k) => s.split('{' + k + '}').join(map[k]), template);
}
function emphasise(text: React.ReactNode, phrase?: string) {
if (typeof text !== 'string' || !phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className='cf-lsf-em'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
const CSS = `
.cf-lsf{--overlap:clamp(120px,15vw,210px);--rail:36px;--sh:var(--shadow, oklch(0.22 0.03 260));position:relative;font-family:var(--font-body);color:var(--ink);background:var(--surface)}
.cf-lsf *,.cf-lsf *::before,.cf-lsf *::after{box-sizing:border-box}
.cf-lsf-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-lsf-wrap{position:relative;max-width:1120px;margin:0 auto;padding:0 clamp(16px,5vw,48px)}
.cf-lsf-top{position:relative;background:var(--surface);color:var(--ink);padding:clamp(56px,8vw,112px) 0 calc(var(--overlap) + 40px)}
.cf-lsf-head{max-width:calc(46rem + 2 * clamp(16px,5vw,48px));text-align:center}
.cf-lsf-h2{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.025em);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance}
.cf-lsf-em{color:var(--accent)}
.cf-lsf-lead{margin:16px auto 0;max-width:40em;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-lsf-aside{margin:12px auto 0;max-width:40em;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-style:italic;color:var(--ink);text-wrap:pretty}
.cf-lsf-toggle{position:relative;display:grid;grid-template-columns:1fr 1fr;width:min(100%,30rem);min-width:0;margin:32px auto 0;padding:6px;border:0;border-radius:calc(var(--radius,12px) + 6px);background:var(--secondary,color-mix(in oklch,var(--ink) 8%,var(--surface)));box-shadow:inset 0 1px 2px oklch(from var(--sh) l c h / 0.2)}
.cf-lsf-thumb{position:absolute;top:6px;bottom:6px;left:6px;width:calc(50% - 6px);border-radius:var(--radius,12px);background:var(--card);box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--sh) l c h / 0.22),0 4px 10px -2px oklch(from var(--sh) l c h / 0.2));transition:transform .4s cubic-bezier(.2,.7,.2,1)}
.cf-lsf-thumb[data-pos='1']{transform:translateX(100%)}
.cf-lsf-opt{position:relative;z-index:1;display:flex;min-height:60px;cursor:pointer;border-radius:var(--radius,12px)}
.cf-lsf-opt input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.cf-lsf-optface{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:8px 12px;border-radius:var(--radius,12px);color:var(--secondary-ink,var(--ink));transition:color .2s ease,background-color .2s ease}
.cf-lsf-opt[data-on='false']:hover .cf-lsf-optface{background:oklch(from var(--secondary-ink,var(--ink)) l c h / 0.06)}
.cf-lsf-opt[data-on='true'] .cf-lsf-optface{color:var(--ink)}
.cf-lsf-opt input:focus-visible + .cf-lsf-optface{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.6);outline-offset:2px}
.cf-lsf-optname{font-family:var(--font-display);font-weight:800;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.2}
.cf-lsf-optrent{font-size:.875rem;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums}
.cf-lsf-bottom{position:relative;z-index:1;background:var(--band);color:var(--band-ink);padding-bottom:clamp(64px,8.5vw,120px)}
.cf-lsf-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(20px,3vw,32px);align-items:stretch;margin-top:calc(var(--overlap) * -1)}
.cf-lsf-card{position:relative;display:flex;flex-direction:column;gap:16px;padding:clamp(20px,3vw,32px);background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(from var(--sh) l c h / 0.22),0 4px 10px -2px oklch(from var(--sh) l c h / 0.2)));transition:transform .45s cubic-bezier(.2,.7,.2,1),box-shadow .45s ease,border-color .45s ease}
.cf-lsf-card[data-featured='true']{transform:translateY(-8px);border-color:color-mix(in oklch,var(--accent) 50%,var(--card));box-shadow:var(--shadow-lg,0 2px 4px oklch(from var(--sh) l c h / 0.22),0 12px 24px -8px oklch(from var(--sh) l c h / 0.32))}
.cf-lsf-flag{position:absolute;top:-15px;left:clamp(20px,3vw,32px);display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:4px 12px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));font-size:.875rem;font-weight:800;line-height:1.2;box-shadow:var(--shadow-sm,0 1px 3px oklch(from var(--sh) l c h / 0.2));opacity:0;visibility:hidden;transform:scale(.9);transition:opacity .3s ease,transform .3s ease,visibility 0s linear .3s}
.cf-lsf-card[data-featured='true'] .cf-lsf-flag{opacity:1;visibility:visible;transform:scale(1);transition:opacity .3s ease,transform .3s ease,visibility 0s}
.cf-lsf-cardhead{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px 12px}
.cf-lsf-h3{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-lsf-tag{margin:6px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
.cf-lsf-avail{display:inline-flex;align-items:center;gap:8px;min-height:30px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
.cf-lsf-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--success)}
.cf-lsf-avail[data-open='false'] .cf-lsf-dot{background:var(--danger)}
.cf-lsf-plan{position:relative;flex:none;margin:0;aspect-ratio:4/3;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-lsf-plan img{position:absolute;top:14px;left:14px;display:block;width:calc(100% - 28px);height:calc(100% - 28px);object-fit:contain;object-position:center;filter:grayscale(0) drop-shadow(0 2px 3px oklch(from var(--sh) l c h / 0.22)) drop-shadow(0 10px 14px oklch(from var(--sh) l c h / 0.14));transition:opacity .45s ease,filter .45s ease}
.cf-lsf-card[data-featured='false'] .cf-lsf-plan img{opacity:.8;filter:grayscale(.45) drop-shadow(0 2px 3px oklch(from var(--sh) l c h / 0.18)) drop-shadow(0 10px 14px oklch(from var(--sh) l c h / 0.08))}
.cf-lsf-rent{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;margin:4px 0 0;line-height:1}
.cf-lsf-num{font-family:var(--font-display);font-weight:800;letter-spacing:-0.03em;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-lsf-per{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;color:var(--muted)}
.cf-lsf-facts{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0}
.cf-lsf-facts div{padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-lsf-facts dt{font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.cf-lsf-facts dd{margin:6px 0 0;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;line-height:1.3;color:var(--ink);font-variant-numeric:tabular-nums}
.cf-lsf-special{margin:0;padding:12px 16px;border-radius:10px;background:var(--success-soft);color:var(--success);font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
.cf-lsf-inl{display:inline-block;vertical-align:-.2em;margin-inline-end:.45em}
.cf-lsf-cardact{display:flex;flex-direction:column;align-items:stretch;justify-content:center;min-height:64px;margin-top:auto;padding-top:4px}
.cf-lsf-cardact .cf-lsf-btn{width:100%}
.cf-lsf-btn{--b:var(--button-bg,var(--cta));--dl:0;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));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-wrap:balance;text-decoration:none;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);cursor:pointer;background:linear-gradient(oklch(from var(--b) calc(l + 0.04 - var(--dl)) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.02 - var(--dl)) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--b) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--sh) l c h / 0.3),0 8px 16px -6px oklch(from var(--sh) l c h / 0.42));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-lsf-btn:not(:disabled):hover,.cf-lsf-btn[data-force='hover']:not(:disabled){--dl:0.05;transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--b) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--b) calc(l - 0.18) c h),0 1px 2px oklch(from var(--sh) l c h / 0.34),0 12px 20px -6px oklch(from var(--sh) l c h / 0.5))}
.cf-lsf-btn:not(:disabled):active,.cf-lsf-btn[data-force='active']:not(:disabled){--dl:0.08;transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--b) calc(l - 0.2) c h / 0.55),inset 0 -2px 0 oklch(from var(--b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--sh) l c h / 0.3)}
.cf-lsf-btn:focus-visible{outline:3px solid oklch(from var(--b) l c h / 0.5);outline-offset:3px}
.cf-lsf-btn:disabled{background:var(--secondary,color-mix(in oklch,var(--ink) 10%,var(--card)));color:var(--secondary-ink,var(--ink));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:not-allowed;transform:none}
.cf-lsf-quiet{align-self:center;min-height:44px;padding:8px 12px;border:0;border-radius:8px;background:none;font-family:var(--font-body);font-size:.9375rem;font-weight:600;line-height:1.3;color:var(--muted);text-decoration:underline;text-decoration-color:oklch(from var(--muted) l c h / 0.5);text-underline-offset:.18em;cursor:pointer;transition:color .16s ease}
.cf-lsf-quiet:not(:disabled):hover{color:var(--ink);text-decoration-color:currentColor}
.cf-lsf-quiet:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.5);outline-offset:2px}
.cf-lsf-quiet:disabled{text-decoration:none;cursor:not-allowed}
.cf-lsf-compare{max-width:52rem;margin:clamp(48px,6vw,80px) auto 0}
.cf-lsf-ctitle{color:var(--band-ink)}
.cf-lsf-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px;margin:16px 0 24px;font-size:.9375rem;font-weight:600;line-height:1.4;color:oklch(from var(--band-ink) l c h / 0.85)}
.cf-lsf-legitem{display:inline-flex;align-items:center;gap:8px}
.cf-lsf-key{flex:none;width:12px;height:12px;border-radius:50%;border:2px solid oklch(from var(--band-ink) l c h / 0.6)}
.cf-lsf-key[data-diff='true']{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent))}
.cf-lsf-path{position:relative;padding-left:var(--rail)}
.cf-lsf-row{position:relative;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);gap:8px 16px;align-items:start;margin:0 -12px;padding:16px 12px;border-top:1px solid oklch(from var(--band-ink) l c h / 0.14)}
.cf-lsf-row--head{border-top:0;padding-top:0;padding-bottom:12px}
.cf-lsf-label{display:flex;align-items:flex-start;gap:10px;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;line-height:1.45;color:var(--band-ink)}
.cf-lsf-label svg{flex:none;margin-top:3px}
.cf-lsf-headlabel,.cf-lsf-colhead{font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.06em;text-transform:uppercase;color:oklch(from var(--band-ink) l c h / 0.82)}
.cf-lsf-colhead{display:flex;align-items:center;gap:6px}
.cf-lsf-colhead[data-feat='true']{color:var(--band-ink)}
.cf-lsf-cell{min-width:0}
.cf-lsf-val{display:inline-block;max-width:100%;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:600;line-height:1.45;color:oklch(from var(--band-ink) l c h / 0.82);font-variant-numeric:tabular-nums;text-wrap:balance}
.cf-lsf-val[data-feat='true']{color:var(--band-ink);font-weight:800}
.cf-lsf-val[data-feat='true'][data-diff='true']{margin:-3px 0 -3px -10px;padding:3px 10px;border-radius:8px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));animation:cf-lsf-pop .3s cubic-bezier(.2,.7,.2,1) var(--d,0s) both}
.cf-lsf-row.cf-lsf-stop[data-diff='true']{animation:cf-lsf-flash 1s ease-out var(--d,0s) both}
.cf-lsf-stop::before{content:'';position:absolute;z-index:1;left:calc(12px - var(--rail));top:22px;width:12px;height:12px;border-radius:50%;border:2px solid oklch(from var(--band-ink) l c h / 0.6);background:var(--band)}
.cf-lsf-stop[data-diff='true']::before{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));animation:cf-lsf-pop .3s cubic-bezier(.2,.7,.2,1) var(--d,0s) both}
.cf-lsf-stop::after{content:'';position:absolute;left:calc(17px - var(--rail));top:34px;bottom:-22px;width:2px;background:oklch(from var(--band-ink) l c h / 0.3)}
.cf-lsf-actionstop{position:relative;display:flex;flex-direction:column;align-items:flex-start;margin:0 -12px;padding:16px 12px 0;border-top:1px solid oklch(from var(--band-ink) l c h / 0.14)}
.cf-lsf-actionstop::before{left:calc(10px - var(--rail));width:16px;height:16px;background:var(--band-ink);border-color:var(--band-ink)}
.cf-lsf-actionstop::after{display:none}
.cf-lsf-instr{margin:0 0 24px;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--band-ink);text-wrap:pretty}
.cf-lsf-ctagroup{display:flex;flex-direction:column;align-items:center;width:min(100%,28rem);text-align:center}
.cf-lsf-btn--close{width:100%;min-height:72px}
.cf-lsf-actionstop .cf-lsf-btn:focus-visible{outline-color:var(--band-ink)}
.cf-lsf-note{margin:12px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;text-align:center;color:oklch(from var(--band-ink) l c h / 0.85);text-wrap:pretty}
.cf-lsf-quiet--band{display:none;align-self:center;margin-top:8px;color:var(--band-ink);text-decoration-color:oklch(from var(--band-ink) l c h / 0.55)}
.cf-lsf-quiet--band:not(:disabled):hover{color:var(--band-ink);text-decoration-color:currentColor}
.cf-lsf-quiet--band:focus-visible{outline-color:var(--band-ink)}
@keyframes cf-lsf-flash{from{background:oklch(from var(--band-ink) l c h / 0.12)}to{background:oklch(from var(--band-ink) l c h / 0)}}
@keyframes cf-lsf-pop{from{transform:scale(.9);opacity:.6}to{transform:scale(1);opacity:1}}
@keyframes cf-lsf-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (max-width:759px){
.cf-lsf{--overlap:110px;--rail:28px}
.cf-lsf-top{padding-bottom:calc(var(--overlap) + 32px)}
.cf-lsf-toggle{width:100%}
.cf-lsf-cards{grid-template-columns:minmax(0,1fr)}
.cf-lsf-card[data-featured='false']{display:none}
.cf-lsf-card[data-featured='true']{transform:none;animation:cf-lsf-in .45s cubic-bezier(.2,.7,.2,1) both}
.cf-lsf-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.cf-lsf-row .cf-lsf-label{grid-column:1 / -1}
.cf-lsf-headlabel{display:none}
.cf-lsf-ctagroup{width:100%}
.cf-lsf-btn--close{padding:0 24px}
.cf-lsf-quiet--band{display:inline-block}
}
@media (prefers-reduced-motion:reduce){
.cf-lsf *,.cf-lsf *::before,.cf-lsf *::after{animation:none !important;transition:none !important}
}
`;
pieces/offer/listing-showcase-3/specimen.tsx 58 lines
import __studioImageb4092462 from "../assets/614e89bab2c01cd3.webp";
import __studioImagee92baae8 from "../assets/e598c3dbddbf1fa1.webp";
import * as React from 'react';
import { ListingShowcase3 } from '../listing-showcase-3';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled'];
export default function ListingShowcase3Specimen({ state = 'default' }: { state?: 'default' | 'hover' | 'active' | 'disabled' }) {
return (
<ListingShowcase3
state={state}
headline='Studio or one-bed? Put them side by side'
emphasis='side by side'
lead='Two floor plans at The Marlowe Lofts, compared line by line. Pick the one that fits your life, then come stand in it.'
aside='(I know. 190 square feet sounds small on paper. Then you open that walk-in closet.)'
compareTitle='See every difference before you tour'
note='Tours take about 20 minutes · No application needed to visit'
defaultFeatured={1}
units={[
{
id: 'studio',
name: 'The Studio',
tagline: 'Open plan · 4th floor',
planImage: slot('item-1', __studioImageb4092462),
planAlt: 'Floor plan of The Studio: open living and sleeping area, galley kitchen, bathroom and reach-in closet',
rent: '$1,650',
rentUnit: '/mo',
size: '520 sq ft',
moveIn: 'Dec 1',
available: true,
special: 'First month free on a 13-month lease',
},
{
id: 'one-bed',
name: 'The One-Bed',
tagline: 'Corner unit · 6th floor',
planImage: slot('item-2', __studioImagee92baae8),
planAlt: 'Floor plan of The One-Bed: separate bedroom with walk-in closet, living room, kitchen island and bathroom',
rent: '$2,050',
rentUnit: '/mo',
size: '710 sq ft',
moveIn: 'Jan 15',
available: true,
},
]}
rows={[
{ label: 'Living space', icon: 'size', values: ['520 sq ft', '710 sq ft'] },
{ label: 'Bedroom', icon: 'bedroom', values: ['Sleep nook, open plan', 'Separate room with a door'] },
{ label: 'Closet', icon: 'closet', values: ['Reach-in, 6 ft wide', 'Walk-in, 7 × 5 ft'] },
{ label: 'Natural light', icon: 'light', values: ['2 east-facing windows', '4 windows on two corner walls'] },
{ label: 'Laundry', icon: 'laundry', values: ['In-unit washer & dryer', 'In-unit washer & dryer'] },
{ label: 'Rent', icon: 'rent', values: ['$1,650 / mo', '$2,050 / mo'] },
{ label: 'Move-in', icon: 'move-in', values: ['Dec 1', 'Jan 15'] },
]}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalListingShowcase3 |
React.ReactNode |
|
emphasis OptionalListingShowcase3 |
string |
|
lead OptionalListingShowcase3 |
React.ReactNode |
|
aside OptionalListingShowcase3 |
React.ReactNode |
|
units OptionalListingShowcase3 |
[FloorPlanUnit, FloorPlanUnit] |
|
rows OptionalListingShowcase3 |
CompareRow[] |
|
compareTitle OptionalListingShowcase3 |
React.ReactNode |
|
note OptionalListingShowcase3 |
string |
|
defaultFeatured OptionalListingShowcase3 |
0 | 1 |
|
copy OptionalListingShowcase3 |
Partial<ListingShowcase3Copy> |
|
href OptionalListingShowcase3 |
string |
|
onAction OptionalListingShowcase3 |
(detail: { unitId: string }) => void |
|
onFeatureChange OptionalListingShowcase3 |
(unitId: string) => void |
|
state OptionalListingShowcase3 |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalListingShowcase3 |
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-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.
-
614e89bab2c01cd3.webp
image/webp · 186 KB
-
e598c3dbddbf1fa1.webp
image/webp · 69.4 KB