> For the complete documentation index, see [llms.txt](https://docs.sharinpix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sharinpix.com/documentation/cookbook/display-an-upload-button-in-a-lightning-web-component.md).

# 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
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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
