Either/Or Play

Binary choice game. Users pick between two options across multiple rounds, with a tutorial screen, timed rounds, score tracking, and an optional standings panel on results.

Import

import { EitherOrPlay } from "fansunited-frontend-components";
import { EitherOrPlayProps, WidgetTemplate } from "fansunited-frontend-core";

Required props

PropTypeDescription
entityIdstringEither/Or game identifier.
sdkFansUnitedSDKModelSDK instance.
templateWidgetTemplateSTANDARD or OVERLAY. (No SPLIT.)
languageLanguageTypeDisplay language.

Optional props

PropTypeDescription
themeOptionsCustomThemeOptionsSee Theming.
leadsLeadsOptionsSee Lead Collection.
imagePosition"left" | "right"STANDARD template only.
defaultImagePlaceholderUrlstringFallback image URL.
userIsLoggedInbooleanHost auth state.
signInCTASignInCTADetailsSee Sign-in CTA.
additionalCTAAdditionalCTADetailsSee Additional CTA.
rulesDisplayRulesDisplaySee Rules Display.
showStandingsbooleanShow standings/leaderboard panel on the results screen.

Gameplay

  1. Tutorial screen introduces the rules.
  2. Rounds — each round shows two options side by side. The user picks one before the round timer expires.
  3. Results screen displays the score and (optionally) standings vs. other participants.

Standings panel

showStandings={true} adds a leaderboard panel on the results screen showing how the user ranks vs. other participants.

<EitherOrPlay {...otherProps} showStandings />

Examples

Basic

<EitherOrPlay
  entityId="either-or-123"
  sdk={sdk}
  template={WidgetTemplate.STANDARD}
  language="en"
/>

Customized

<EitherOrPlay
  entityId="either-or-123"
  sdk={sdk}
  template={WidgetTemplate.OVERLAY}
  language="en"
  showStandings
  userIsLoggedIn={false}
  signInCTA={{ defaultLabel: "Sign in to play", onClick: openSignIn }}
  leads={{
    position: "after",
    fields: ["fullName", "email"],
    campaignId: "either-or-campaign",
    campaignName: "Fan Preference 2024",
    phoneCountryCode: "44",
    syncWithProfile: true,
  }}
  themeOptions={{ mode: "dark" }}
/>