Badges

The Badges Component simplifies the process of creating and awarding badges to users. Whether you want to gamify your application or recognize user achievements.

Component Visuals

To unlock early access to the component Get Access

Demo

In this video, you'll learn:

  1. How to use the component.

  2. Customization options for the Badges component.

Installation

To install the Quest react-native-native-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:

npm install @questlabs/react-native-sdk

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.


Props of Login Component

The Badgescomponent accepts the following props

Prop NameTypeRequired Details

ImageSize

number

optional

The Main Image Size.

innerImageX

number

optional

The X of innerImage.

innerImageY

number

optional

The Y of InnerImage.

innerImageSize

number

optional

The Inner Image size.

innerImage

string | any

optional

The inner Image.

lock

boolean

required

Ture or False.

Usage

To integrate the Badges component into your React application, follow these steps

  • Import the Badges Component: Import the Tutorial component from the @questlabs/react--native-sdk package.

import { Badges } from "@questlabs/react-native-sdk";

Example Usage

Here's an example of how to use the Banner component within your React Native application.

import {  SafeAreaView, StyleSheet } from "react-native";
import React, { useState } from "react";
import {
  Badge,
} from "@questlabs/react-native-sdk/src/components";

export default function App() {

  return (
    <SafeAreaView style={styles.container}>
      <Badge
        lock={true}
        innerImage={require("./tickImage.png")}
        innerImageSize={30}
        innerImageX={38}
        innerImageY={28}
      />
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "white",
    marginTop: 40,
    justifyContent: "center",
  },
});

The above example not uses all the props.

Last updated