> For the complete documentation index, see [llms.txt](https://docs.questera.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.questera.ai/questera-ai-sdks/react-sdk-components/expansion/cross-selling-component.md).

# Cross-Selling Component

{% tabs %}
{% tab title="Overview" %}

<figure><img src="/files/KQRzfb4p8BIqyPVLKZI0" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Visual 1" %}

<figure><img src="/files/UDcMPoQMNmfRYlv2oLNV" alt="" width="563"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Visual 2" %}

<figure><img src="/files/YxR103rLOJrM34aGjeI8" alt="" width="563"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
To unlock early access to the component                                                           [**Get Access**](https://bijfwfnqtsj.typeform.com/to/eUXDpbuh)
{% endhint %}

## Installation

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:

```jsx
npm install @questlabs/react-sdk
```

> This command will download and install the package and its dependencies into your project.

{% hint style="info" %}
Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.
{% endhint %}

***

## Usage

To integrate the `Cross-Selling` component into your React application, follow these steps

* **Import the CSS**: In your JavaScript or TypeScript file where you're using the `Tutorial`, import the CSS styles for the component. This ensures that the component's styling is applied correctly.

```jsx
import '@questlabs/react-sdk/dist/style.css'
```

* **Import the TutorialComponent**: Import the `CrossSelling` component from the `@questlabs/react-sdk` package.
* **Import the QuestProvider Component**: Import the `QuestProvider` component from the `@questlabs/react-sdk` package.

```jsx
import { QuestProvider, CrossSelling } from '@questlabs/react-sdk';
```

* **Pass the Required Props**:  Pass the required props to the `QuestProvider`. The required props are `apiKey`,  and `entityId`. and required props for the `CrossSelling` component are `userId, questId, token`

{% hint style="info" %}
Replace `"your-api-key"` and `"your-entity-id"` with your actual Quest API credentials&#x20;
{% endhint %}

{% hint style="info" %}
Replace `"your-token"`, `"your-user-id", "your-questId"` with your actual configuration details.
{% endhint %}

## Code & Steps

{% tabs %}
{% tab title="QuestProvider" %}

```jsx
import { QuestProvider, CrossSelling } from '@questlabs/react-sdk';
import '@questlabs/react-sdk/dist/style.css'

function App() {
  return (
      <QuestProvider
        apiKey="your-apikey"
        entityId="your-entity-Id" 
        apiType= "PRODUCTION" // STAGING 
      >
      <CrossSelling> </CrossSelling>
      </QuestProvider>
  );
}

export default App;
```

{% endtab %}

{% tab title="CrossSelling" %}

```jsx
  <CrossSelling
          userId=""
          questId=""
          token=""
          uniqueUserId="your-unique-user-id"
        >
    // children
</CrossSelling>
```

{% endtab %}

{% tab title="Header" %}

```jsx
<CrossSelling.Header />
```

{% endtab %}

{% tab title="MainContent" %}

```
<CrossSelling.MainContent >
    <CrossSelling.Icon 
        type=""
    />
    <CrossSelling.Timer />
    <CrossSelling.EmailInput />
    <CrossSelling.ActionButtons />
</CrossSelling.MainContent>
```

{% endtab %}

{% tab title="Preview" %}

<pre class="language-jsx"><code class="lang-jsx">&#x3C;QuestProvider
    apiKey="your-apikey"
    entityId="your-entity-Id" 
    apiType= "PRODUCTION" // STAGING 
>
<strong>  &#x3C;CrossSelling
</strong>      userId=""
      questId=""
      token=""
      uniqueUserId="your-unique-user-id"
   >
     &#x3C;CrossSelling.Header  />
     &#x3C;CrossSelling.Content />
     &#x3C;CrossSelling.MainContent >
       &#x3C;CrossSelling.Icon />
       &#x3C;CrossSelling.Timer />
       &#x3C;CrossSelling.EmailInput />
       &#x3C;CrossSelling.ActionButtons />
     &#x3C;/CrossSelling.MainContent>
   &#x3C;/CrossSelling>
&#x3C;/QuestProvider>
</code></pre>

{% endtab %}
{% endtabs %}

***

## **Example Usage**

Here's an example of how to use the `Tutorial`component within your React application

{% tabs %}
{% tab title="CrossSelling" %}

```jsx
import { QuestProvider, CrossSelling } from '@questlabs/react-sdk';
import '@questlabs/react-sdk/dist/style.css'

function App() {
  return (
    <div>
      <QuestProvider
        apiKey="your-apikey"
        entityId="your-entity-Id" 
        apiType= "PRODUCTION" // STAGING 
      >
        <CrossSelling
          userId=""
          questId=""
          token=""
          uniqueUserId="your-unique-user-id"
        >
           <CrossSelling.Header  />
           <CrossSelling.Content />
           <CrossSelling.MainContent >
             <CrossSelling.Icon />
             <CrossSelling.Timer />
             <CrossSelling.EmailInput />
             <CrossSelling.ActionButtons />
           </CrossSelling.MainContent>
         </CrossSelling>
      </QuestProvider>   
      </div>
  );
}

export default App;
```

{% endtab %}

{% tab title="CrossSellingPreview" %}

```jsx
import { QuestProvider, CrossSellingWrapper } from '@questlabs/react-sdk';
import '@questlabs/react-sdk/dist/style.css'

function App() {
  return (
    <div>
      <QuestProvider
        apiKey="your-apikey"
        entityId="your-entity-Id"
        apiType= "PRODUCTION" // STAGING 
      >
       <CrossSellingWrapper
          userId=""
          questId=""
          token=""
          uniqueUserId="your-unique-user-id"
          styleConfig={{
              Timer: {
                  TimerCard: {},
                  backgroundColor: "",
                  primaryColor: "",
                  secondaryColor: ""
              },
              BackgroundWrapper: {},
              Description: {},
              EmailError: {
                  errorStyle: {},
                  text: ""
              },
              Footer: {
                  FooterIcon: {},
                  FooterStyle: {},
                  FooterTextStyle: {},
                  FooterText: ""
              },
              Form: {},
              gradientDescription: {},
              gradientHeading: {},
              Heading: {},
              Icon: {},
              Input: {},
              Label: {},
              PrimaryButton: {},
              SecondaryButton: {},
          }}
          showFooter={false}
        />
      </QuestProvider>
    </div>
  );
}

export default App;
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The above example uses all the props.
{% endhint %}

## Props of Cross-Selling Component

The **`Cross-Selling`**  component accepts the following props

<table><thead><tr><th width="208">Prop Name</th><th width="95">Type</th><th width="128">Required</th><th>Details</th></tr></thead><tbody><tr><td><strong>heading</strong></td><td>string</td><td>optional</td><td>The title or heading of the Cross-Selling</td></tr><tr><td><strong>headingColor</strong></td><td>string</td><td>optional</td><td>for heading color</td></tr><tr><td><strong>color</strong></td><td>string</td><td>optional</td><td>for text or descirption color</td></tr><tr><td><strong>userId</strong></td><td>string</td><td>required </td><td>The unique identifier of the user.</td></tr><tr><td><strong>description</strong></td><td>string</td><td>optional</td><td>A brief description  for the Cross-Selling</td></tr><tr><td><strong>iconColor</strong></td><td>string</td><td>optional</td><td>set icon color</td></tr><tr><td><strong>primaryHeading</strong></td><td>string</td><td>optional</td><td>main heading that's show on top of the component</td></tr><tr><td><strong>token</strong></td><td>string</td><td>required</td><td>An authentication token or API key necessary for accessing Cross-Selling or quest data.</td></tr><tr><td><strong>questId</strong></td><td>string</td><td>required</td><td>The unique identifier for the Cross-Selling or quest.</td></tr><tr><td><strong>shareButtonText</strong></td><td>string</td><td>optional</td><td>The text of the Avail Now.</td></tr><tr><td><strong>gradientBackground</strong></td><td>boolean</td><td>optional</td><td>This gives gradient background to the component.</td></tr><tr><td><strong>primaryDescription</strong></td><td>boolean</td><td>optional</td><td>The description when gradientBackround is true.</td></tr><tr><td><strong>primartHeading</strong></td><td>string</td><td>optonal</td><td>The text or heading when gradientBackround is true.</td></tr><tr><td><strong>showDays</strong></td><td>boolean</td><td>optional</td><td>To show the days in Timer .</td></tr><tr><td><strong>expiryDate</strong></td><td>number</td><td>optional</td><td>To set expiry Date to Cross-Selling component.</td></tr><tr><td><strong>claimRewardHandler</strong></td><td>function</td><td>optional</td><td>Function triggered on claiming the reward.</td></tr><tr><td><strong>backButtonTrigger</strong></td><td>function</td><td>optional</td><td>Function triggered on clicking the back button.</td></tr><tr><td><strong>uniqueEmailId</strong></td><td>string</td><td>optional</td><td>Unique email ID.</td></tr><tr><td><strong>uniqueUserId</strong></td><td>string</td><td>optional</td><td>Unique user ID.</td></tr><tr><td><strong>showFooter</strong></td><td>boolean</td><td>optional</td><td>true: show quest footer<br>fasle: hide footer</td></tr><tr><td><strong>variation</strong></td><td>string</td><td>optional</td><td>for creating different-2 variation</td></tr><tr><td>styleConfig</td><td>object</td><td>optional</td><td>An object containing CSS properties for styling various components within the cross selling process, including form, headings, descriptions, buttons,timer and footer.</td></tr></tbody></table>

```jsx
styleConfig = {{
    Timer: {
        TimerCard: { },
        backgroundColor: "",
            primaryColor: "",
                secondaryColor: ""
    },
    BackgroundWrapper: { },
    Description: { },
    EmailError: {
        errorStyle: { },
        text: ""
    },
    Footer: {
        FooterIcon: { },
        FooterStyle: { },
        FooterTextStyle: { },
        FooterText: ""
    },
    Form: { },
    gradientDescription: { },
    gradientHeading: { },
    Heading: { },
    Icon: { },
    Input: { },
    Label: { },
    PrimaryButton: { },
    SecondaryButton: { },
}}
```

## Features

* **Responsive Interface:** LIT offers a user-friendly and adaptive interface, ensuring a seamless and enjoyable user experience across various devices.
* **Real-time Collaboration:** Enable effective teamwork with LIT's real-time collaboration features, allowing users to work together on projects and documents simultaneously.

You can customize the UI with type of styleConfig would be


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.questera.ai/questera-ai-sdks/react-sdk-components/expansion/cross-selling-component.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
