Poll Vote
Real-time polling component with single and multiple-choice voting, percentage results, three responsive templates, and the standard sign-in/lead/CTA configuration.
Import
import { PollVote } from "fansunited-frontend-components";
import { PollVoteProps, WidgetTemplate } from "fansunited-frontend-core";Required props
| Prop | Type | Description |
|---|---|---|
entityId | string | Poll identifier. |
sdk | FansUnitedSDKModel | SDK instance. |
template | WidgetTemplate | STANDARD, SPLIT, or OVERLAY. |
language | LanguageType | Display language. |
Optional props
| Prop | Type | Description |
|---|---|---|
themeOptions | CustomThemeOptions | See Theming. |
leads | LeadsOptions | See Lead Collection. |
imagePosition | "left" | "right" | STANDARD template only. |
defaultImagePlaceholderUrl | string | Fallback image URL. |
userIsLoggedIn | boolean | Host auth state for sign-in-gated polls. |
signInCTA | SignInCTADetails | See Sign-in CTA. |
additionalCTA | AdditionalCTADetails | See Additional CTA. |
rulesDisplay | RulesDisplay | See Rules Display. |
Voting behavior
- Single or multiple choice is determined by the poll configuration on the backend.
- Vote attempt limits are enforced server-side. The component disables the form once a user has reached the limit and shows the results view instead.
- Real-time results are fetched after a successful vote and updated on the results screen.
Examples
Basic
<PollVote
entityId="poll-123"
sdk={sdk}
template={WidgetTemplate.STANDARD}
language="en"
/>Customized
<PollVote
entityId="poll-123"
sdk={sdk}
template={WidgetTemplate.OVERLAY}
language="en"
userIsLoggedIn={false}
signInCTA={{ defaultLabel: "Sign in to vote", onClick: openSignIn }}
leads={{
position: "after",
fields: ["fullName", "email"],
campaignId: "poll-campaign",
campaignName: "User Survey 2024",
syncWithProfile: true,
}}
themeOptions={{ mode: "dark" }}
/>Updated about 1 month ago
Did this page help you?
