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.
The LeaderBoard
component accepts the following props
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 TutorialComponent: Import the LeaderBoard
component from the @questlabs/react-sdk
package.
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
, and entityId
. and required props for the LeaderBoard
component are userId, questId, token
Replace "your-api-key"
and "your-entity-id"
with your actual Quest API credentials
Replace "your-token"
, "your-user-id", "your-questId"
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.
The Leaderboard
component accepts the following props:
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 .
userLimit
number
optional
Limits the user
isXpImage
boolean
optional
Hide or show Xp image
DefaultImage
string
optional
To set default image
DefaultName
string
optional
To set default Nmae
FirstRankIconImage
string
optional
To set the image of first ranker
SecondRankIconImage
string
optional
To set the image of second ranker
ThirdRankIconImage
string
optional
To set the image of third ranker
IsTopRank
boolean
optional
To tell top rank or not
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.
You can customize the UI with type of styleConfig would be