Member Login 1
Member login and signup: an angled brand field reminds members what is waiting inside, while the form gets them back in with a password or a one-tap email link.
Use it in a prompt
Use forms/member-login from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/forms/member-login.tsx. - Import it and pass your copy and images (Props tab):
import { MemberLogin } from "@/components/funneldna/forms/member-login"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/member-login/component.tsx 642 lines
// layout: diagonal-split
// Member login and signup: an angled brand field reminds members what is waiting inside, while the form gets them back in with a password or a one-tap email link.
import * as React from "react";
import { AlertCircle, Check, Eye, EyeOff, KeyRound, Loader2, Mail } from "lucide-react";
export type MemberLoginMode = "login" | "signup";
export type MemberLoginMethod = "password" | "magic";
export type MemberLoginItem = {
name: string;
detail?: string;
/** item-n slot image; a solid tick badge shows when it is absent */
image?: string;
imageAlt?: string;
};
/** What onSubmit receives: only the fields the visitor was asked for */
export type MemberLoginValues = {
mode: MemberLoginMode;
method: MemberLoginMethod;
email: string;
name?: string;
password?: string;
};
export type MemberLoginCopy = {
tabsLabel: string;
tabLogin: string;
tabSignup: string;
loginQuestion: string;
signupQuestion: string;
nameLabel: string;
namePlaceholder: string;
emailLabel: string;
emailPlaceholder: string;
passwordLabel: string;
passwordPlaceholder: string;
newPasswordPlaceholder: string;
/** "{min}" is replaced with minPasswordLength */
passwordHint: string;
forgotPassword: string;
showPassword: string;
hidePassword: string;
loginAction: string;
signupAction: string;
magicAction: string;
busyAction: string;
divider: string;
useMagic: string;
usePassword: string;
magicNote: string;
psLabel: string;
insideLabel: string;
nameRequired: string;
emailRequired: string;
emailInvalid: string;
passwordRequired: string;
/** "{min}" is replaced with minPasswordLength */
passwordShort: string;
};
export type MemberLoginProps = {
/** Headline on the angled brand field */
headline?: React.ReactNode;
/** product slot: course or brand art on a transparent background */
productImage?: string;
productImageAlt?: string;
/** The short "what you get inside" reminder */
items?: MemberLoginItem[];
defaultMode?: MemberLoginMode;
defaultMethod?: MemberLoginMethod;
/** Minimum password length when creating an account */
minPasswordLength?: number;
/** P.S. line under the action (guarantee or main benefit); hidden when empty */
ps?: React.ReactNode;
/** Form-level message from the host, e.g. a rejected password */
error?: string;
/** The host is processing the submit: the button shows a spinner */
busy?: boolean;
disabled?: boolean;
state?: "default" | "hover" | "active" | "disabled" | "error";
onSubmit?: (values: MemberLoginValues) => void;
/** Called with the email typed so far */
onForgotPassword?: (email: string) => void;
onModeChange?: (mode: MemberLoginMode) => void;
copy?: Partial<MemberLoginCopy>;
className?: string;
};
export function MemberLogin(props: MemberLoginProps) {
const {
headline = "Your course is waiting inside",
productImage,
productImageAlt = "",
items = DEFAULT_ITEMS,
defaultMode = "login",
defaultMethod = "password",
minPasswordLength = 8,
ps,
error,
busy = false,
disabled = false,
state = "default",
onSubmit,
onForgotPassword,
onModeChange,
copy: copyOverrides,
className,
} = props;
const copy: MemberLoginCopy = { ...DEFAULT_COPY, ...copyOverrides };
const uid = React.useId();
const [mode, setMode] = React.useState<MemberLoginMode>(defaultMode);
const [method, setMethod] = React.useState<MemberLoginMethod>(defaultMethod);
const [values, setValues] = React.useState<Record<Field, string>>({ name: "", email: "", password: "" });
const [touched, setTouched] = React.useState<Record<Field, boolean>>(EMPTY_FLAGS);
const [tried, setTried] = React.useState(false);
const [showPassword, setShowPassword] = React.useState(false);
const fieldRefs = {
name: React.useRef<HTMLInputElement>(null),
email: React.useRef<HTMLInputElement>(null),
password: React.useRef<HTMLInputElement>(null),
};
const tabRefs = {
login: React.useRef<HTMLButtonElement>(null),
signup: React.useRef<HTMLButtonElement>(null),
};
const locked = disabled || state === "disabled";
const isSignup = mode === "signup";
const isMagic = method === "magic";
const active: Field[] = isSignup
? isMagic ? ["name", "email"] : ["name", "email", "password"]
: isMagic ? ["email"] : ["email", "password"];
const errors = validate(values, active, isSignup, minPasswordLength, copy);
const showAll = tried || state === "error";
const errorFor = (f: Field) => (active.includes(f) && (showAll || touched[f]) ? errors[f] : undefined);
const ids = {
name: `${uid}-name`,
email: `${uid}-email`,
password: `${uid}-password`,
hint: `${uid}-hint`,
tabLogin: `${uid}-tab-login`,
tabSignup: `${uid}-tab-signup`,
panel: `${uid}-panel`,
};
const update = (f: Field) => (e: React.ChangeEvent<HTMLInputElement>) => {
const v = e.target.value;
setValues((prev) => ({ ...prev, [f]: v }));
};
const blur = (f: Field) => () => {
if (values[f]) setTouched((prev) => ({ ...prev, [f]: true }));
};
const changeMode = (next: MemberLoginMode) => {
if (next === mode) return;
setMode(next);
setTried(false);
setTouched(EMPTY_FLAGS);
setShowPassword(false);
onModeChange?.(next);
};
const onTabKey = (e: React.KeyboardEvent<HTMLButtonElement>) => {
const other: MemberLoginMode = isSignup ? "login" : "signup";
const map: Record<string, MemberLoginMode> = { ArrowLeft: other, ArrowRight: other, Home: "login", End: "signup" };
const next = map[e.key];
if (!next) return;
e.preventDefault();
changeMode(next);
tabRefs[next].current?.focus();
};
const toggleMethod = () => {
setMethod((m) => (m === "magic" ? "password" : "magic"));
setTried(false);
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (locked || busy) return;
setTried(true);
const first = active.find((f) => errors[f]);
if (first) {
fieldRefs[first].current?.focus();
return;
}
onSubmit?.({
mode,
method,
email: values.email.trim(),
...(isSignup ? { name: values.name.trim() } : {}),
...(isMagic ? {} : { password: values.password }),
});
};
const question = isSignup ? copy.signupQuestion : copy.loginQuestion;
const actionLabel = busy ? copy.busyAction : isMagic ? copy.magicAction : isSignup ? copy.signupAction : copy.loginAction;
const forced = state === "hover" ? " is-hover" : state === "active" ? " is-active" : "";
const nameErr = errorFor("name");
const emailErr = errorFor("email");
const passwordErr = errorFor("password");
const passwordDescribedBy = [isSignup ? ids.hint : "", passwordErr ? `${ids.password}-err` : ""].filter(Boolean).join(" ") || undefined;
return (
<div className={["cf-ml", className].filter(Boolean).join(" ")}>
<style>{CSS}</style>
<div className={`cf-ml__shell${isSignup ? " is-signup" : ""}`}>
<div className="cf-ml__side">
<div className="cf-ml__intro">
{productImage ? (
<figure className="cf-ml__art cf-ml__rv" style={rv(0)}>
<img src={productImage} alt={productImageAlt} width={640} height={480} decoding="async" />
</figure>
) : null}
<h2 className="cf-ml__title cf-ml__rv" style={rv(1)}>{headline}</h2>
</div>
{items.length > 0 ? (
<ul className="cf-ml__list" aria-label={copy.insideLabel}>
{items.map((item, i) => (
<li key={`${item.name}-${i}`} className="cf-ml__item cf-ml__rv" style={rv(Math.min(i + 2, 4))}>
{item.image ? (
<img className="cf-ml__thumb" src={item.image} alt={item.imageAlt ?? ""} width={56} height={56} loading="lazy" decoding="async" />
) : (
<span className="cf-ml__badge" aria-hidden="true">
<Check size={20} strokeWidth={3} />
</span>
)}
<div>
<p className="cf-ml__name">{item.name}</p>
{item.detail ? <p className="cf-ml__detail">{item.detail}</p> : null}
</div>
</li>
))}
</ul>
) : null}
</div>
<div className="cf-ml__main">
<div className="cf-ml__tabs cf-ml__rv" role="tablist" aria-label={copy.tabsLabel} style={rv(1)}>
<span className="cf-ml__slide" aria-hidden="true" />
{(["login", "signup"] as const).map((m) => (
<button
key={m}
ref={tabRefs[m]}
id={m === "login" ? ids.tabLogin : ids.tabSignup}
type="button"
role="tab"
className="cf-ml__tab"
aria-selected={mode === m}
aria-controls={ids.panel}
tabIndex={mode === m ? 0 : -1}
disabled={locked}
onClick={() => changeMode(m)}
onKeyDown={onTabKey}
>
{m === "login" ? copy.tabLogin : copy.tabSignup}
</button>
))}
</div>
<form
id={ids.panel}
role="tabpanel"
aria-labelledby={isSignup ? ids.tabSignup : ids.tabLogin}
className="cf-ml__form cf-ml__rv"
style={rv(2)}
noValidate
onSubmit={handleSubmit}
aria-busy={busy || undefined}
>
<fieldset className="cf-ml__fieldset" disabled={locked}>
<h3 className="cf-ml__q">
<span key={question} className="cf-ml__swap">{question}</span>
</h3>
{error ? (
<p className="cf-ml__alert" role="alert">
<AlertCircle aria-hidden="true" size={18} strokeWidth={2.5} />
{error}
</p>
) : null}
<Collapse open={isSignup} edge="bottom">
<div className="cf-ml__field">
<label className="cf-ml__label" htmlFor={ids.name}>{copy.nameLabel}</label>
<input
ref={fieldRefs.name}
id={ids.name}
className="cf-ml__input"
type="text"
name="name"
autoComplete="name"
placeholder={copy.namePlaceholder}
value={values.name}
onChange={update("name")}
onBlur={blur("name")}
tabIndex={isSignup ? undefined : -1}
aria-invalid={nameErr ? true : undefined}
aria-describedby={nameErr ? `${ids.name}-err` : undefined}
/>
<FieldError id={`${ids.name}-err`} message={nameErr} />
</div>
</Collapse>
<div className="cf-ml__field">
<label className="cf-ml__label" htmlFor={ids.email}>{copy.emailLabel}</label>
<input
ref={fieldRefs.email}
id={ids.email}
className="cf-ml__input"
type="email"
name="email"
inputMode="email"
autoComplete="email"
placeholder={copy.emailPlaceholder}
value={values.email}
onChange={update("email")}
onBlur={blur("email")}
aria-invalid={emailErr ? true : undefined}
aria-describedby={emailErr ? `${ids.email}-err` : undefined}
/>
<FieldError id={`${ids.email}-err`} message={emailErr} />
</div>
<Collapse open={!isMagic} edge="top">
<div className="cf-ml__field">
<div className="cf-ml__labelrow">
<label className="cf-ml__label" htmlFor={ids.password}>{copy.passwordLabel}</label>
{isSignup ? (
<span id={ids.hint} className="cf-ml__hint">{fill(copy.passwordHint, minPasswordLength)}</span>
) : (
<button
type="button"
className="cf-ml__link"
tabIndex={isMagic ? -1 : undefined}
onClick={() => onForgotPassword?.(values.email.trim())}
>
{copy.forgotPassword}
</button>
)}
</div>
<div className="cf-ml__pw">
<input
ref={fieldRefs.password}
id={ids.password}
className="cf-ml__input"
type={showPassword ? "text" : "password"}
name="password"
autoComplete={isSignup ? "new-password" : "current-password"}
placeholder={isSignup ? copy.newPasswordPlaceholder : copy.passwordPlaceholder}
value={values.password}
onChange={update("password")}
onBlur={blur("password")}
tabIndex={isMagic ? -1 : undefined}
aria-invalid={passwordErr ? true : undefined}
aria-describedby={passwordDescribedBy}
/>
<button
type="button"
className="cf-ml__eye"
aria-label={showPassword ? copy.hidePassword : copy.showPassword}
aria-controls={ids.password}
tabIndex={isMagic ? -1 : undefined}
onClick={() => setShowPassword((s) => !s)}
>
{showPassword ? (
<EyeOff aria-hidden="true" size={20} strokeWidth={2.5} />
) : (
<Eye aria-hidden="true" size={20} strokeWidth={2.5} />
)}
</button>
</div>
<FieldError id={`${ids.password}-err`} message={passwordErr} />
</div>
</Collapse>
<Collapse open={isMagic} edge="top">
<p className="cf-ml__note">
<Mail aria-hidden="true" size={18} strokeWidth={2.5} />
{copy.magicNote}
</p>
</Collapse>
<button
type="submit"
className={`cf-ml__primary${forced}${busy ? " is-busy" : ""}`}
disabled={locked}
aria-disabled={busy || undefined}
>
{busy ? <Loader2 className="cf-ml__spin" aria-hidden="true" size={20} strokeWidth={2.5} /> : null}
<span key={actionLabel} className="cf-ml__swap">{actionLabel}</span>
</button>
<div className="cf-ml__or" aria-hidden="true">
<span>{copy.divider}</span>
</div>
<button type="button" className="cf-ml__secondary" onClick={toggleMethod} disabled={locked}>
<span key={isMagic ? "pw" : "magic"} className="cf-ml__swap cf-ml__seclabel">
{isMagic ? (
<KeyRound aria-hidden="true" size={20} strokeWidth={2.5} />
) : (
<Mail aria-hidden="true" size={20} strokeWidth={2.5} />
)}
{keepWords(isMagic ? copy.usePassword : copy.useMagic)}
</span>
</button>
{ps ? (
<p className="cf-ml__ps">
<strong>{copy.psLabel}</strong> {ps}
</p>
) : null}
</fieldset>
</form>
</div>
</div>
</div>
);
}
export default MemberLogin;
type Field = "name" | "email" | "password";
const EMPTY_FLAGS: Record<Field, boolean> = { name: false, email: false, password: false };
const DEFAULT_ITEMS: MemberLoginItem[] = [
{ name: "Every lesson, in order", detail: "Pick up exactly where you stopped last time." },
{ name: "Your downloads in one place", detail: "Guides, workbooks and checklists, ready to use." },
{ name: "Your next step, spelled out", detail: "Know what to do today, not someday." },
];
const DEFAULT_COPY: MemberLoginCopy = {
tabsLabel: "Log in or create your account",
tabLogin: "Log in",
tabSignup: "Create account",
loginQuestion: "Ready to pick up where you left off?",
signupQuestion: "Ready to start your first lesson?",
nameLabel: "Full name",
namePlaceholder: "Jane Smith",
emailLabel: "Email address",
emailPlaceholder: "you@example.com",
passwordLabel: "Password",
passwordPlaceholder: "Your password",
newPasswordPlaceholder: "Create a password",
passwordHint: "{min}+ characters",
forgotPassword: "Forgot password?",
showPassword: "Show password",
hidePassword: "Hide password",
loginAction: "Yes, take me inside",
signupAction: "I’m ready, show me how",
magicAction: "Email me my sign-in link",
busyAction: "One moment…",
divider: "or",
useMagic: "Email me a sign-in link instead",
usePassword: "Use my password instead",
magicNote: "No password needed. We’ll email you a one-tap link to get in.",
psLabel: "P.S.",
insideLabel: "What’s waiting inside",
nameRequired: "Enter your full name.",
emailRequired: "Enter your email address.",
emailInvalid: "That email doesn’t look right. Check it for typos.",
passwordRequired: "Enter your password.",
passwordShort: "Use at least {min} characters.",
};
function FieldError({ id, message }: { id: string; message?: string }) {
if (!message) return null;
return (
<p id={id} className="cf-ml__err">
<AlertCircle aria-hidden="true" size={16} strokeWidth={2.5} />
{message}
</p>
);
}
function Collapse({ open, edge, children }: { open: boolean; edge: "top" | "bottom"; children: React.ReactNode }) {
return (
<div className={open ? "cf-ml__collapse" : "cf-ml__collapse is-collapsed"} aria-hidden={open ? undefined : true}>
<div className="cf-ml__clip">
<div className={`cf-ml__pad cf-ml__pad--${edge}`}>{children}</div>
</div>
</div>
);
}
function validate(
values: Record<Field, string>,
active: Field[],
isSignup: boolean,
min: number,
copy: MemberLoginCopy,
): Partial<Record<Field, string>> {
const out: Partial<Record<Field, string>> = {};
if (active.includes("name") && !values.name.trim()) out.name = copy.nameRequired;
if (active.includes("email")) {
const email = values.email.trim();
if (!email) out.email = copy.emailRequired;
else if (!looksLikeEmail(email)) out.email = copy.emailInvalid;
}
if (active.includes("password")) {
if (!values.password) out.password = copy.passwordRequired;
else if (isSignup && values.password.length < min) out.password = fill(copy.passwordShort, min);
}
return out;
}
function looksLikeEmail(v: string) {
const at = v.indexOf("@");
const dot = v.lastIndexOf(".");
return at > 0 && at === v.lastIndexOf("@") && dot > at + 1 && dot < v.length - 2 && !v.includes(" ");
}
function fill(template: string, min: number) {
return template.split("{min}").join(String(min));
}
/** Keeps hyphenated words ("sign-in") whole so a wrapping label never breaks at the hyphen. */
function keepWords(text: string): React.ReactNode {
return text.split(/(\s+)/).map((part, i) =>
part.includes("-") ? (
<span key={i} className="cf-ml__nw">
{part}
</span>
) : (
part
),
);
}
function rv(i: number) {
return { "--i": i } as React.CSSProperties;
}
// The status badge glyph is white per the theme contract (solid status badge), read through --success-ink with a #fff fallback.
// The tab track is a quiet grey well inside the card, so it mixes ink into --card (not --surface).
// Tabs, the forgot-password link and the show-password eye are utility buttons: they take their corner radius from
// --button-radius (falling back to --radius), so a theme's button shape reaches them; their colours stay on ink/link/field tokens.
const CSS = `
.cf-ml{--ml-slope:clamp(44px,8cqi,88px);--ml-pad:clamp(20px,4.6cqi,48px);--ml-ease:cubic-bezier(.2,.7,.2,1);--ml-shadow:var(--shadow,oklch(0.22 0.03 260));container-type:inline-size;width:100%;max-width:1040px;margin-inline:auto;font-family:var(--font-body,system-ui,sans-serif);color:var(--ink,#101828);}
.cf-ml,.cf-ml *{box-sizing:border-box;}
.cf-ml__shell{display:grid;grid-template-columns:minmax(0,1.04fr) minmax(0,1fr);align-items:stretch;background:var(--card,#fff);border:1px solid var(--card-border,oklch(from var(--ink,#101828) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)));overflow:hidden;}
.cf-ml__side{position:relative;isolation:isolate;display:flex;flex-direction:column;gap:32px;padding:var(--ml-pad) calc(var(--ml-slope) + 28px) calc(var(--ml-pad) + 8px) var(--ml-pad);background:var(--band,#1b2a4a);color:var(--band-ink,#fff);clip-path:polygon(0 0,100% 0,calc(100% - var(--ml-slope)) 100%,0 100%);}
.cf-ml__side::before{content:'';position:absolute;inset:0;z-index:-1;background:var(--accent-fill,var(--accent,#2563eb));clip-path:polygon(calc(100% - 12px) 0,100% 0,calc(100% - var(--ml-slope)) 100%,calc(100% - var(--ml-slope) - 12px) 100%);pointer-events:none;}
.cf-ml__intro{display:grid;gap:24px;align-items:start;}
.cf-ml__art{margin:0;}
.cf-ml__art img{display:block;width:100%;max-width:300px;height:auto;aspect-ratio:4/3;object-fit:contain;object-position:left center;filter:drop-shadow(0 2px 3px oklch(from var(--ml-shadow) calc(l - .08) c h / .5)) drop-shadow(0 14px 18px oklch(from var(--ml-shadow) calc(l - .08) c h / .45));}
.cf-ml__title{margin:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,4.4cqi,2.75rem);line-height:1.06;text-wrap:balance;color:var(--band-ink,#fff);}
.cf-ml__list{list-style:none;margin:0;padding:0;display:grid;gap:16px;}
.cf-ml__item{display:grid;grid-template-columns:auto minmax(0,1fr);gap:16px;align-items:start;}
.cf-ml__thumb{display:block;width:56px;height:56px;border-radius:8px;object-fit:cover;object-position:center;}
.cf-ml__badge{display:grid;place-items:center;width:40px;height:40px;border-radius:999px;background:var(--success,oklch(0.5 0.14 150));color:var(--success-ink,#fff);}
.cf-ml__name{margin:0;font-size:1.0625rem;font-weight:800;line-height:1.3;color:var(--band-ink,#fff);text-wrap:pretty;}
.cf-ml__detail{margin:4px 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;color:color-mix(in oklab,var(--band-ink,#fff) 80%,var(--band,#1b2a4a));text-wrap:pretty;}
.cf-ml__main{display:flex;flex-direction:column;min-width:0;padding:var(--ml-pad) var(--ml-pad) var(--ml-pad) clamp(16px,3cqi,32px);}
.cf-ml__tabs{position:relative;display:grid;grid-template-columns:1fr 1fr;padding:4px;margin:0 0 28px;border-radius:var(--button-radius,var(--radius,12px));background:color-mix(in oklch,var(--ink,#101828) 7%,var(--card,#fff));box-shadow:inset 0 1px 2px oklch(from var(--ml-shadow) l c h / .1);}
.cf-ml__slide{position:absolute;top:4px;bottom:4px;left:4px;width:calc(50% - 4px);border:1px solid oklch(from var(--ink,#101828) l c h / .1);border-radius:max(0px,calc(var(--button-radius,var(--radius,12px)) - 4px));background:var(--card,#fff);box-shadow:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / .18),0 1px 3px oklch(0.22 0.03 260 / .14));transition:transform .28s var(--ml-ease);}
.is-signup .cf-ml__slide{transform:translateX(100%);}
.cf-ml__tab{position:relative;z-index:1;min-height:48px;padding:0 12px;border:0;border-radius:max(0px,calc(var(--button-radius,var(--radius,12px)) - 4px));background:transparent;font:inherit;font-size:1rem;font-weight:800;line-height:1.2;white-space:nowrap;color:color-mix(in oklch,var(--ink,#101828) 76%,var(--card,#fff));cursor:pointer;transition:color .16s ease;}
.cf-ml__tab:hover:not(:disabled),.cf-ml__tab[aria-selected=true]{color:var(--ink,#101828);}
.cf-ml__tab:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:2px;}
.cf-ml__tab:disabled{cursor:not-allowed;}
.cf-ml__fieldset{margin:0;padding:0;border:0;min-width:0;}
.cf-ml__q{margin:0 0 20px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,2.6cqi,1.625rem);line-height:1.15;text-wrap:balance;color:var(--ink,#101828);}
.cf-ml__alert{margin:0 0 20px;padding:12px 16px;border-radius:10px;background:var(--danger-soft,oklch(0.93 0.024 27));color:var(--danger,oklch(0.5 0.17 27));font-size:.9375rem;font-weight:600;line-height:1.45;text-wrap:pretty;}
.cf-ml__alert svg,.cf-ml__err svg,.cf-ml__note svg{display:inline-block;vertical-align:-0.18em;margin-inline-end:.45em;}
.cf-ml__collapse{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows .32s var(--ml-ease),opacity .24s ease;}
.cf-ml__collapse.is-collapsed{grid-template-rows:0fr;opacity:0;visibility:hidden;transition:grid-template-rows .32s var(--ml-ease),opacity .2s ease,visibility 0s linear .32s;}
.cf-ml__clip{min-height:0;overflow:hidden;margin:0 -4px;padding:0 4px;}
.cf-ml__pad--bottom{padding:4px 0 16px;}
.cf-ml__pad--top{padding:16px 0 4px;}
.cf-ml__field{display:grid;gap:8px;}
.cf-ml__labelrow{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;}
.cf-ml__label{font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink,#101828));}
.cf-ml__hint{font-size:.9375rem;font-weight:500;line-height:1.3;color:var(--muted,#475467);}
.cf-ml__input{display:block;width:100%;min-height:56px;padding:0 16px;font:inherit;font-size:1.0625rem;line-height:1.3;color:var(--field-ink,#101828);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#101828) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--ml-shadow) l c h / .08);appearance:none;transition:border-color .16s ease,box-shadow .16s ease;}
.cf-ml__input::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#fff));opacity:1;}
.cf-ml__input:hover:not(:disabled):not(:focus){border-color:color-mix(in oklch,var(--ink,#101828) 40%,transparent);}
.cf-ml__input:focus{outline:none;border-color:var(--field-focus,var(--accent,#2563eb));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent,#2563eb)) l c h / .35);}
.cf-ml__input[aria-invalid=true]{border-color:var(--danger,oklch(0.5 0.17 27));}
.cf-ml__input[aria-invalid=true]:focus{box-shadow:0 0 0 3px oklch(from var(--danger,oklch(0.5 0.17 27)) l c h / .3);}
.cf-ml__input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink,#101828) 5%,var(--field,#fff));}
.cf-ml__pw{position:relative;}
.cf-ml__pw .cf-ml__input{padding-right:60px;}
.cf-ml__eye{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:min(8px,var(--button-radius,var(--radius,12px)));background:transparent;color:color-mix(in oklch,var(--field-ink,#101828) 72%,var(--field,#fff));cursor:pointer;transition:background .16s ease,color .16s ease;}
.cf-ml__eye:hover:not(:disabled){background:color-mix(in oklch,var(--field-ink,#101828) 7%,var(--field,#fff));color:var(--field-ink,#101828);}
.cf-ml__eye:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:-3px;}
.cf-ml__eye:disabled{cursor:not-allowed;}
.cf-ml__err{margin:0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger,oklch(0.5 0.17 27));text-wrap:pretty;animation:cf-ml-rise .3s var(--ml-ease) both;}
.cf-ml__link{padding:10px 0;margin:-10px 0;border:0;border-radius:min(4px,var(--button-radius,var(--radius,12px)));background:none;font:inherit;font-size:.9375rem;font-weight:700;line-height:1.3;color:var(--link,var(--accent,#2563eb));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent,#2563eb)) l c h / .45);text-underline-offset:.18em;cursor:pointer;}
.cf-ml__link:hover:not(:disabled){color:oklch(from var(--link,var(--accent,#2563eb)) calc(l - .08) c h);text-decoration-color:currentColor;}
.cf-ml__link:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:2px;}
.cf-ml__note{margin:0;padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#fff));font-size:.9375rem;font-weight:500;line-height:1.45;color:var(--ink,#101828);text-wrap:pretty;}
.cf-ml__note svg{color:var(--accent,#2563eb);}
.cf-ml__primary{--ml-btn:var(--button-bg,var(--cta,#d92d20));--ml-btn-2:var(--button-bg-2,var(--cta-2,var(--ml-btn)));display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin-top:20px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--ml-btn) calc(l + .04) c h),oklch(from var(--ml-btn-2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#fff));font-family:var(--button-font,var(--font-display,inherit));font-size:clamp(1.125rem,2.4cqi,1.375rem);font-weight:var(--button-weight,800);line-height:1.15;text-transform:var(--button-case,none);text-shadow:var(--button-text-shadow,none);white-space:nowrap;cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ml-btn) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--ml-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--ml-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--ml-shadow) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease;}
.cf-ml__primary:hover:not(:disabled):not(.is-busy),.cf-ml__primary.is-hover{background:linear-gradient(oklch(from var(--ml-btn) calc(l - .01) c h),oklch(from var(--ml-btn-2) calc(l - .07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ml-btn) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--ml-btn) calc(l - .2) c h),0 1px 2px oklch(from var(--ml-shadow) l c h / .32),0 12px 20px -6px oklch(from var(--ml-shadow) l c h / .5));}
.cf-ml__primary:active:not(:disabled):not(.is-busy),.cf-ml__primary.is-active{background:linear-gradient(oklch(from var(--ml-btn) calc(l - .04) c h),oklch(from var(--ml-btn-2) calc(l - .08) c h));transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--ml-btn) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--ml-btn) calc(l - .16) c h),0 1px 1px oklch(from var(--ml-shadow) l c h / .25);}
.cf-ml__primary:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:3px;}
.cf-ml__primary:disabled{background:color-mix(in oklch,var(--ink,#101828) 10%,var(--card,#fff));color:var(--muted,#475467);text-shadow:none;box-shadow:none;transform:none;cursor:not-allowed;}
.cf-ml__primary.is-busy{cursor:progress;}
.cf-ml__or{display:flex;align-items:center;gap:12px;margin:16px 0;font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.08em;text-transform:uppercase;color:var(--muted,#475467);}
.cf-ml__or::before,.cf-ml__or::after{content:'';flex:1;height:1px;background:oklch(from var(--ink,#101828) l c h / .14);}
.cf-ml__secondary{display:grid;place-items:center;width:100%;min-height:56px;padding:10px 20px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary,oklch(0.93 0.015 263)));color:var(--button-2-ink,var(--secondary-ink,var(--ink,#101828)));font-family:var(--button-font,var(--font-display,inherit));font-size:1.0625rem;font-weight:var(--button-weight,800);line-height:1.2;text-transform:var(--button-case,none);text-align:center;text-wrap:balance;cursor:pointer;box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / .18),0 1px 3px oklch(0.22 0.03 260 / .14)));transition:transform .16s ease,background .16s ease,box-shadow .16s ease;}
.cf-ml__seclabel{text-align:center;text-wrap:balance;}
.cf-ml__seclabel svg{display:inline-block;vertical-align:-0.22em;margin-inline-end:.45em;}
.cf-ml__nw{white-space:nowrap;}
.cf-ml__secondary:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary,oklch(0.93 0.015 263))) calc(l - .04) c h);}
.cf-ml__secondary:active:not(:disabled){transform:translateY(1px);box-shadow:none;}
.cf-ml__secondary:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:3px;}
.cf-ml__secondary:disabled{opacity:.6;cursor:not-allowed;}
.cf-ml__ps{margin:20px 0 0;font-size:.9375rem;font-weight:500;line-height:1.45;color:var(--muted,#475467);text-wrap:pretty;}
.cf-ml__ps strong{font-weight:800;color:var(--ink,#101828);}
.cf-ml__rv{animation:cf-ml-rise .45s var(--ml-ease) both;animation-delay:calc(var(--i,0) * .07s);}
.cf-ml__swap{display:inline-block;animation:cf-ml-swap .3s var(--ml-ease) both;}
.cf-ml__spin{flex:none;animation:cf-ml-spin .8s linear infinite;}
@keyframes cf-ml-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-ml-swap{from{opacity:.4;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes cf-ml-spin{to{transform:rotate(360deg)}}
@container (max-width: 820px){
.cf-ml__shell{grid-template-columns:minmax(0,1fr);}
.cf-ml__side{gap:24px;padding:var(--ml-pad) var(--ml-pad) calc(var(--ml-pad) + 52px);clip-path:polygon(0 0,100% 0,100% 100%,0 calc(100% - 40px));}
.cf-ml__side::before{clip-path:polygon(0 calc(100% - 52px),100% calc(100% - 12px),100% 100%,0 calc(100% - 40px));}
.cf-ml__intro{grid-template-columns:minmax(0,1fr) clamp(96px,26cqi,160px);gap:16px;}
.cf-ml__art{grid-column:2;grid-row:1;}
.cf-ml__art img{max-width:none;}
.cf-ml__title{font-size:clamp(1.75rem,6.4cqi,2.5rem);}
.cf-ml__thumb{width:48px;height:48px;}
.cf-ml__main{padding:20px var(--ml-pad) var(--ml-pad);}
}
@container (max-width: 400px){
.cf-ml__tab{padding:0 8px;font-size:.9375rem;}
.cf-ml__secondary{padding:10px 16px;}
}
@media (prefers-reduced-motion: reduce){
.cf-ml__rv,.cf-ml__swap,.cf-ml__err,.cf-ml__spin{animation:none;}
.cf-ml__slide,.cf-ml__collapse,.cf-ml__collapse.is-collapsed,.cf-ml__primary,.cf-ml__secondary,.cf-ml__input,.cf-ml__tab,.cf-ml__eye{transition:none;}
.cf-ml__primary:hover:not(:disabled),.cf-ml__primary.is-hover,.cf-ml__primary:active:not(:disabled),.cf-ml__primary.is-active,.cf-ml__secondary:active:not(:disabled){transform:none;}
}
`;
pieces/forms/member-login/specimen.tsx 28 lines
import __studioImage067e28bd from "../assets/4874fae4dc40d41c.webp";
import { MemberLogin, type MemberLoginProps } from "../member-login";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
const sample = defaults.sample;
export const states = ["default", "hover", "active", "disabled", "error"];
export default function MemberLoginSpecimen({ state = "default" }: { state?: MemberLoginProps["state"] }) {
return (
<MemberLogin
state={state}
headline="Your Funnel Starter Kit is waiting inside"
productImage={slot("product", __studioImage067e28bd)}
productImageAlt={`${sample.name}: planning guide, copy workbook and launch checklist`}
items={sample.items.map((item, i) => ({
name: item.name,
detail: item.detail,
image: slot(`item-${i + 1}`, item.image),
imageAlt: item.imageAlt,
}))}
copy={{ signupQuestion: "Ready to map your first funnel?" }}
ps={`Your kit is covered by our ${sample.guarantee}, so explore everything inside with zero risk.`}
error={state === "error" ? "That email and password don’t match. Try again, or get a sign-in link by email." : undefined}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalMemberLogin |
React.ReactNode |
|
productImage OptionalMemberLogin |
string |
|
productImageAlt OptionalMemberLogin |
string |
|
items OptionalMemberLogin |
MemberLoginItem[] |
|
defaultMode OptionalMemberLogin |
MemberLoginMode |
|
defaultMethod OptionalMemberLogin |
MemberLoginMethod |
|
minPasswordLength OptionalMemberLogin |
number |
|
ps OptionalMemberLogin |
React.ReactNode |
|
error OptionalMemberLogin |
string |
|
busy OptionalMemberLogin |
boolean |
|
disabled OptionalMemberLogin |
boolean |
|
state OptionalMemberLogin |
"default" | "hover" | "active" | "disabled" | "error" |
|
onSubmit OptionalMemberLogin |
(values: MemberLoginValues) => void |
|
onForgotPassword OptionalMemberLogin |
(email: string) => void |
|
onModeChange OptionalMemberLogin |
(mode: MemberLoginMode) => void |
|
copy OptionalMemberLogin |
Partial<MemberLoginCopy> |
|
className OptionalMemberLogin |
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--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
product- The main product shot or cover (ebook, kit, bottle).
-
4874fae4dc40d41c.webp
image/webp · 150 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB