Leaderboard
A ranked list of users aggregated across one or more game entities, with pagination.
A widget that displays a ranked list of users based on their performance across one or more game entities (Match Quiz, Classic Quiz, Top X, or a custom Template). It supports paginated results and can aggregate scores across multiple entities simultaneously.
<div
data-component="fu-widget"
data-content-type="leaderboard"
data-entities='[{"id":"your-match-quiz-id","type":"MATCH_QUIZ"},{"id":"your-top-x-id","type":"TOP_X"}]'
data-leaderboard-page-size="10"
></div>Configuration Attributes
| Attribute | Description | Options/Format | Default |
|---|---|---|---|
data-entities | JSON array of entities to include in the leaderboard | Array of { "id": string, "type": EntityType } | Required |
data-leaderboard-page-size | Number of leaderboard entries to display per page | Positive integer | Config default |
You can also set
leaderboard.pageSizeglobally inFuWidget.init().
Entity Types
Each entry in data-entities must include an id and a type. Supported entity types (case-insensitive):
| Type | Description |
|---|---|
MATCH_QUIZ | Leaderboard for a Match Quiz game |
CLASSIC_QUIZ | Leaderboard for a Classic Quiz game |
TOP_X | Leaderboard for a Top X game |
TEMPLATE | Aggregated leaderboard across a custom template grouping |
Examples
Single Entity
<div
data-component="fu-widget"
data-content-type="leaderboard"
data-entities='[{"id":"your-match-quiz-id","type":"MATCH_QUIZ"}]'
data-leaderboard-page-size="20"
></div>Multiple Entities
Leaderboards are displayed as options from a dropdown menu. The options (leaderboards) will be in the same order as data-entities.
<div
data-component="fu-widget"
data-content-type="leaderboard"
data-entities='[{"id":"top-x-1","type":"TOP_X"},{"id":"match-quiz-2","type":"MATCH_QUIZ"}]'
data-leaderboard-page-size="10"
></div>Multiple Quizzes
Combine scores from several classic quizzes into one leaderboard (Overall):
<div
data-component="fu-widget"
data-content-type="leaderboard"
data-entities='[{"id":"classic-quiz-1","type":"CLASSIC_QUIZ"},{"id":"classic-quiz-2","type":"CLASSIC_QUIZ"}]'
data-leaderboard-page-size="10"
></div>Template Entity
Use a TEMPLATE entity type to display an aggregated leaderboard defined by a custom server-side grouping:
<div
data-component="fu-widget"
data-content-type="leaderboard"
data-entities='[{"id":"your-template-id","type":"TEMPLATE"}]'
data-leaderboard-page-size="10"
></div>The Leaderboard is one of two widgets (with Betslip) loaded via
entities/no-idrather than a single contentid. See Getting Started → Widget Loading Approaches for theloadWidget()form.
Features
- Ranked user list with positions, names, and scores
- Supports aggregation across multiple game entities
- Paginated results with configurable page size
- Works with Match Quiz, Classic Quiz, Top X, and Template entity types
- Responsive design
