Leaderboard Component
The Leaderboard component efficiently displays and manages leaderboards in React, offering customizable styling. Users can easily monitor progress and compete through its clear interface.
Last updated
The Leaderboard component efficiently displays and manages leaderboards in React, offering customizable styling. Users can easily monitor progress and compete through its clear interface.
Last updated
To unlock early access to the component Get Access
To install the Quest react-sdk
into your project, follow these steps:
Open your terminal/command prompt.
Navigate to your project's root directory using the cd
command if you're not already there.
Run the following command to install the quest-sdk
package using npm:
This command will download and install the package and its dependencies into your project.
Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.
Customizable Styling: Users can customize the appearance of the leaderboard to align with their platform's branding or design preferences. This includes options to adjust colors, fonts, and layout, providing a seamless integration into the overall user interface.
Versatile Leaderboard Component: Integrate a comprehensive leaderboard feature into your app, enabling dynamic tracking and visualization of user standings based on accumulated points or experience. Tailor the leaderboard to suit diverse engagement scenarios and foster competition and community interaction within your platform.
The Leaderboard
component accepts the following props:
Prop Name | Type | Required | Details |
---|---|---|---|
token | string | required | An authentication token or API key necessary for accessing Leaderboard or quest data. |
userId | string | required | The unique identifier of the user. |
styleConfig | object | optional | An object containing CSS properties for styling various components within the Leaderboard process, including main heading, heading, descriptions, points color,,points background,inner background, index color, index background , progressbar color, and icon style . |
You can customize the UI with type of styleConfig would be
To integrate the Leaderboard
component into your React application, follow these steps:
Import the CSS: In your JavaScript or TypeScript file where you're using the Leaderboard
, import the CSS styles for the component. This ensures that the component's styling is applied correctly.
Import the QuestProvider Component: Import the QuestProvider
component from the @questlabs/react-sdk
package.
Pass the Required Props: Pass the required props to the QuestProvider
. The required props are apiKey
, apiSecret
, apiType
and entityId
. Additionally, include an optional themeConfig
. and required props for the Leaderboard
component are userId
,token
, with an optional prop styleConfig
.
Replace "your-api-key","apiSecret"
and "your-entity-id"
with your actual Quest API credentials
Replace "your -userId" and "your-token"
with your actual configuration details.
Here's an example of how to use the Leaderboard
component within your React application
The above example uses all the props.