# Display an upload button in a Lightning Web Component

This article explains how to embed the [SharinPix Upload Button](/documentation/lightning-web-component/sharinpix-upload-button.md) component in a Lightning Web Component.

## Call the SharinPix Upload Button (LWC) inside Lightning Web Component

The sample code below demonstrates how to call the **SharinPix Upload Button (LWC)** inside the markup of a Lightning Web Component.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>60.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
    </targets>
</LightningComponentBundle>
```

```html
<template>
  <sharinpix-sharinpix-upload
      album-id={recordId}
      label={label}
      component-id={componentId}
      enable-action={enableAction}
      enable-image-sync={enableImageSync}
      enable-toast={enableToast}
      permission-id={permissionId}
      auto-tags={autoTags}>
  </sharinpix-sharinpix-upload>
</template>
```

```javascript
import { LightningElement, api } from 'lwc';

export default class UploadButton extends LightningElement {
    @api recordId
    label = // label
    componentId = // componentId
    enableAction = // enableAction
    enableImageSync = // enableImageSync
    enableToast = // enableToast
    permissionId = // permission Name or Id
    autoTags = // autoTags
    
    //The parameters are explained in more details below.
}
```

{% hint style="warning" %}
**Note:**

* The parameter's value can be modified as per your use-case.
* The **SharinPixPermissionName** highlighted above should be replaced with the name or Id of a [SharinPix Permission](/documentation/access-and-security/sharinpix-permission-object-how-to-create-and-assign-custom-permission.md).
  {% endhint %}

The table below details the parameters available of the SharinPix Upload Button (LWC).

| Parameter       | Type    | Description                                                                                                                                                                                                                                                                           |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| albumId         | String  | Corresponds to the Salesforce record ID (album ID) to which the photos should be uploaded. This parameter is <mark style="color:$danger;">**mandatory**</mark>.                                                                                                                       |
| label           | String  | Used to configure the button label.                                                                                                                                                                                                                                                   |
| componentId     | String  | Takes the user-defined component ID as value to identify this component when using multiple components.                                                                                                                                                                               |
| enableAction    | Boolean | Enables the [Tag Action](/documentation/features/working-with-tags/tag-action.md) feature on the upload button                                                                                                                                                                        |
| enableImageSync | Boolean | Enables the [Image Sync](/documentation/image-sync/what-are-the-uses-of-image-sync.md) feature on the upload button.                                                                                                                                                                  |
| enableToast     | Boolean | Enables toast on successful image upload.                                                                                                                                                                                                                                             |
| permissionId    | String  | Includes the Salesforce record ID or Name of a [SharinPix Permission record](/documentation/access-and-security/sharinpix-permission-object-how-to-create-and-assign-custom-permission.md) which can be created to control access rights for the *SharinPix Upload Button* component. |
| autoTags        | String  | Used to pass one or more tags to be automatically applied on files uploaded using the \_SharinPix Upload Button \_component. If multiple auto-tags are needed, they should be delimited by a semi-colon. Example: TagA;TagB;TagC                                                      |


---

# Agent Instructions: 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:

```
GET https://docs.sharinpix.com/documentation/cookbook/display-an-upload-button-in-a-lightning-web-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
