Pick The Pair
Pair-matching game. Users match related items from two columns. Supports two game modes (casual and challenge), optional countdown timer, and real-time accuracy tracking.
Import
import { PickThePair } from "fansunited-frontend-components";
import { PickThePairProps, PickThePairTemplate } from "fansunited-frontend-core";Required props
| Prop | Type | Description |
|---|---|---|
entityId | string | Pick The Pair identifier. |
sdk | FansUnitedSDKModel | SDK instance. |
template | PickThePairTemplate | STANDARD, LANDING_PAGE, or OVERLAY. |
language | LanguageType | Display language. |
Optional props
| Prop | Type | Description |
|---|---|---|
themeOptions | CustomThemeOptions | See Theming. |
leads | LeadsOptions | Only position: "after" is supported. See Lead Collection. |
imagePosition | "left" | "right" | STANDARD template only. |
defaultImagePlaceholderUrl | string | Fallback image URL. |
Templates
PickThePair uses its own enum:
enum PickThePairTemplate {
STANDARD = "standard",
LANDING_PAGE = "landing_page",
OVERLAY = "overlay",
}| Template | Description |
|---|---|
STANDARD | Card-based layout with optional side image. Supports imagePosition. |
LANDING_PAGE | Full-width design for standalone pages with prominent branding. |
OVERLAY | Full-screen overlay experience with background image. |
Game modes
Game mode is configured in the Fans United backend, not via props.
Casual
- Relaxed matching, no scoring pressure.
- No success threshold; players match all pairs at their own pace.
- Best for educational content and brand awareness.
Challenge
- Accuracy-based with a configurable success threshold (
successThresholdPercent). - Real-time statistics: attempts, accuracy %, threshold indicator, matched pairs.
- Submit button is disabled until the threshold is met.
Countdown timer
Configured on the backend via timeLimit (in seconds). 0 disables the timer.
When enabled:
- Timer is displayed in
MM:SSand updates in real time. - Starts automatically on load.
- When time expires: all selections are disabled, a "Time's Up" overlay is shown, and the submit button is disabled.
Matching mechanics
- The user clicks an item in one column.
- The user clicks an item in the other column.
- The component checks the pair ID:
- Correct: items stay selected, images reveal (if configured), pair is marked matched.
- Incorrect: red error animation (~800 ms), both selections clear.
- All pairs must be matched to enable submit/continue.
Image behavior
- Images are hidden by default.
- Revealed on selection or match.
- Left column: image appears to the right of the text. Right column: image appears to the left.
- Supports separate
mainandmobileimage variants. - Gracefully handles pairs without images.
Accuracy tracking (Challenge mode)
| Metric | Description |
|---|---|
| Total attempts | Number of match attempts made. |
| Correct matches | Successfully matched pairs. |
| Incorrect attempts | Failed match attempts. |
| Accuracy % | (correct / total) × 100 |
| Success threshold | Required accuracy to submit. |
The submit button is disabled until accuracy ≥ threshold.
Examples
Basic
<PickThePair
entityId="pair-123"
sdk={sdk}
template={PickThePairTemplate.STANDARD}
language="en"
/>Challenge mode (backend config)
// Backend Pick The Pair configuration:
{
"mode": "challenge",
"timeLimit": 120,
"successThresholdPercent": 75
}<PickThePair
entityId="timed-challenge-123"
sdk={sdk}
template={PickThePairTemplate.LANDING_PAGE}
language="en"
themeOptions={{ mode: "dark" }}
/>With lead collection
<PickThePair
entityId="brand-quiz-123"
sdk={sdk}
template={PickThePairTemplate.OVERLAY}
language="en"
leads={{
position: "after",
fields: ["fullName", "email", "phoneNumber"],
campaignId: "brand-awareness",
campaignName: "Product Knowledge Challenge",
phoneCountryCode: "44",
syncWithProfile: true,
}}
themeOptions={{ mode: "light" }}
/>