Core Concepts

The component library is intentionally repetitive on its surface — most components accept the same configuration objects (themes, lead options, CTAs, rules). This section documents that shared surface once, so individual component pages can focus on what's unique to each component.

Mental model

A typical component invocation looks like this:

<ClassicQuizPlay
  entityId="quiz-123"          // identifies the entity in the Fans United backend
  sdk={sdk}                    // shared SDK instance (one per app)
  template={WidgetTemplate.STANDARD}  // layout
  language="en"                // i18n
  themeOptions={...}           // theming
  leads={...}                  // optional inline lead capture
  signInCTA={...}              // optional sign-in CTA (gated entities)
  additionalCTA={...}          // optional CTA on results screen
  rulesDisplay={...}           // optional info icon + modal/link to rules
/>

Every prop after language is shared — the same shape works across nearly every component in the library. Learn it once here; reuse it everywhere.

What's in this section

ConceptWhat it covers
TemplatesThe three core layouts (STANDARD, SPLIT, OVERLAY) and per-component variants.
ThemingCustomThemeOptions — colors, typography, spacing, radii, breakpoints, gradients.
InternationalizationSupported languages, the language prop, and global initializeI18n().
Lead CollectionThe inline leads prop on game components.
Sign-in CTASignInCTADetails — gating authenticated entities behind your sign-in flow.
Additional CTAAdditionalCTADetails — an extra button on the results screen.
Rules DisplayAn info icon that opens a rules modal or links to an external rules page.
Profile SyncWrite collected lead data back to the user's Fans United profile.

How to use this section

  • Read the page once, then refer back when you see the same prop on another component.
  • Each component page links here. When a component page says "see [Theming]", that's where to go for the full shape.
  • Composition is intentionalthemeOptions, leads, signInCTA, etc. can all be combined on the same component without conflict.

Tip: define configuration once, reuse it

For consistency across an integration, define your shared configuration objects in a single module and import them where needed:

// src/widgets/config.ts
import type { CustomThemeOptions, SignInCTADetails } from "fansunited-frontend-core";

export const brandTheme: CustomThemeOptions = { /* ... */ };

export const brandSignInCTA: SignInCTADetails = {
  defaultLabel: "Sign In",
  onClick: () => openSignInModal(),
};
// any widget rendering site
import { brandTheme, brandSignInCTA } from "./widgets/config";

<ClassicQuizPlay
  {...quizProps}
  themeOptions={brandTheme}
  signInCTA={brandSignInCTA}
/>

This keeps theming and CTA behavior centralised — change once, propagate everywhere.