Collect Lead

Standalone lead-collection form with custom fields, consent management, branding, and a configurable success-page CTA. Use this when you want a dedicated lead-capture experience rather than the inline lead form that other game components offer.

Import

import { CollectLead } from "fansunited-frontend-components";
import { CollectLeadProps, WidgetTemplate } from "fansunited-frontend-core";

Required props

PropTypeDescription
entityIdstringLead collection form identifier.
sdkFansUnitedSDKModelSDK instance.
templateWidgetTemplateSTANDARD, SPLIT, or OVERLAY.
languageLanguageTypeDisplay language.

Optional props

PropTypeDescription
themeOptionsCustomThemeOptionsSee Theming.
fieldsLeadField[]Standard form fields to display.
labelsLeadLabelsCustom labels for every text element.
imagePosition"left" | "right"STANDARD template only.
defaultImagePlaceholderUrlstringFallback image URL.
phoneCountryCodestringDefault country code for phone fields.
syncWithProfilebooleanWrite submitted data back to the user's profile. See Profile Sync.
onSuccessCTAOnSuccessCTADetailsCTA shown on the success screen.
customFieldsLeadCustomField[]Additional form fields beyond the standard ones.
consentsLeadConsent[]Consent checkboxes for privacy compliance.
contentContentInfoContent metadata for analytics attribution.
campaignCampaignInfoCampaign metadata for analytics attribution.
brandingBrandingInfoBranding overrides (logos, colors, URLs).
imagesImagesModelImage asset overrides.

Standard fields (LeadField)

type LeadField =
  | "fullName"
  | "firstName"
  | "lastName"
  | "email"
  | "gender"
  | "country"
  | "phoneCountryCode"
  | "phoneNumber";

Custom fields (LeadCustomField)

interface LeadCustomField {
  key: string;
  label: string;
  type: "input" | "textarea";
  required?: boolean;
  placeholder?: string;
}
const customFields: LeadCustomField[] = [
  {
    key: "company",
    label: "Company Name",
    type: "input",
    required: true,
    placeholder: "Enter your company name",
  },
  {
    key: "message",
    label: "Message",
    type: "textarea",
    required: false,
    placeholder: "Tell us about your needs...",
  },
];

Consents (LeadConsent)

interface LeadConsent {
  id: string;
  label: string;
}
const consents: LeadConsent[] = [
  { id: "marketing", label: "I agree to receive marketing communications" },
  { id: "newsletter", label: "Subscribe to our newsletter" },
];

Labels (LeadLabels)

Override every text element shown on the form and success screen.

const labels: LeadLabels = {
  title: "Join Our Community",
  description: "Get exclusive updates and early access to new features",
  formTitle: "Sign Up Today",
  formDescription: "Fill out the form below to get started",
  formFullNameLabel: "Full Name",
  formFullNamePlaceholder: "Enter your full name",
  formEmailLabel: "Email Address",
  formGenderLabel: "Gender",
  formGenderPlaceholder: "Select your gender",
  formCountryLabel: "Country",
  formCountryPlaceholder: "Select your country",
  formPhoneNumberLabel: "Phone Number",
  formPhoneNumberPlaceholder: "Enter your phone number",
  submitButtonLabel: "Subscribe Now",
  successTitle: "Welcome Aboard!",
  successDescription: "Thank you for joining our community. Check your email for next steps.",
  privacyPolicyUrlLabel: "Privacy Policy",
  termsAndConditionsUrlLabel: "Terms & Conditions",
  presentedByLabel: "Powered by",
};

Success CTA (OnSuccessCTADetails)

The same shape as SignInCTADetails / AdditionalCTADetails. Rendered on the success screen after a successful submission.

interface OnSuccessCTADetails {
  defaultLabel?: string;
  onClick?: () => void;
  url?: string | null;
  target?: LinkTargetType;
  component?: React.ReactElement | null;
}

Priority: componentonClickurl → not rendered.

const onSuccessCTA: OnSuccessCTADetails = {
  defaultLabel: "Continue to Dashboard",
  onClick: () => (window.location.href = "/dashboard"),
};

Profile sync

Set syncWithProfile={true} to write submitted values back to the user's Fans United profile. See Profile Sync.

<CollectLead
  entityId="lead-form-123"
  sdk={sdk}
  template={WidgetTemplate.STANDARD}
  language="en"
  fields={["firstName", "lastName", "email", "phoneNumber", "country", "gender"]}
  syncWithProfile
/>

Examples

Basic

<CollectLead
  entityId="lead-form-123"
  sdk={sdk}
  template={WidgetTemplate.STANDARD}
  language="en"
  fields={["fullName", "email"]}
/>

Advanced

<CollectLead
  entityId="lead-form-123"
  sdk={sdk}
  template={WidgetTemplate.OVERLAY}
  language="en"
  fields={["fullName", "email", "phoneNumber", "country"]}
  phoneCountryCode="44"
  syncWithProfile
  customFields={[
    { key: "company", label: "Company", type: "input", required: true },
  ]}
  consents={[
    { id: "marketing", label: "I agree to receive marketing emails" },
  ]}
  labels={{
    title: "Get Early Access",
    submitButtonLabel: "Join Waitlist",
    successTitle: "You're In!",
    successDescription: "We'll notify you when we launch.",
  }}
  onSuccessCTA={{
    defaultLabel: "Learn More",
    url: "https://example.com/learn-more",
    target: "_blank",
  }}
  themeOptions={{ mode: "dark" }}
/>

See also

  • useLeadForm — build a fully custom form using the same submission logic.
  • Lead Collection — for the inline leads prop on game components.