Personality Quiz Play

Personality quiz component that matches users with a persona based on their answers. Features a tabbed result interface with the top match highlighted, percentage breakdowns, and optional answer explanations.

Import

import { PersonalityQuizPlay } from "fansunited-frontend-components";
import { PersonalityQuizPlayProps, WidgetTemplate } from "fansunited-frontend-core";

Required props

PropTypeDescription
entityIdstringPersonality Quiz identifier.
sdkFansUnitedSDKModelSDK instance.
templateWidgetTemplateSTANDARD, SPLIT, or OVERLAY.
languageLanguageTypeDisplay language.

Optional props

PropTypeDescription
themeOptionsCustomThemeOptionsSee Theming.
showAnswerExplanationsbooleanShow explanations on the results screen.
leadsLeadsOptionsSee Lead Collection.
imagePosition"left" | "right"STANDARD template only.
defaultImagePlaceholderUrlstringFallback image URL.
userIsLoggedInbooleanHost auth state.
signInCTASignInCTADetailsSee Sign-in CTA.
additionalCTAAdditionalCTADetailsSee Additional CTA.
optionsLayoutOptionsLayoutLayout of the answer options. See below.
rulesDisplayRulesDisplaySee Rules Display.

Options layout

Controls how answer options are arranged on screen:

type OptionsLayout = "twoByTwo" | "row" | "column";
ValueLayout
twoByTwo2 × 2 grid (default for most personality quizzes).
rowHorizontal row.
columnVertical stack.

Results screen

When the quiz completes, the user sees:

  • The top persona match highlighted (image, name, description).
  • Tabs for other personas with their match percentage.
  • (Optional, with showAnswerExplanations) per-question explanations.

Examples

Basic

<PersonalityQuizPlay
  entityId="personality-123"
  sdk={sdk}
  template={WidgetTemplate.STANDARD}
  language="en"
/>

Customized

<PersonalityQuizPlay
  entityId="personality-123"
  sdk={sdk}
  template={WidgetTemplate.OVERLAY}
  language="en"
  showAnswerExplanations
  optionsLayout="twoByTwo"
  userIsLoggedIn={false}
  signInCTA={{ defaultLabel: "Sign in to save results", onClick: openSignIn }}
  leads={{
    position: "after",
    fields: ["fullName", "email"],
    campaignId: "personality-campaign",
    campaignName: "Personality 2024",
    syncWithProfile: true,
  }}
  themeOptions={{ mode: "dark" }}
/>