SharinPix Custom Upload Button
This component is only available for developers only. It is not available on the Lightning App Builder. Only available on aura framework.
The purpose of this component is to allow image upload from a lightning button which is fully customisable in term user interface using the Lightning Design System framework.
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes">
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="permissionId" type="String"/>
<!-- SharinPix Custom Upload Button start -->
<sharinpix:UploadButtonCustom recordId="{!v.recordId}" permissionId="{!v.permissionId}" enableToast="true" enableImageSync="true" enableAction="true" height="500" refreshView="true" fileExtensions=".jpg,.heic,.pdf">
<span class="slds-button slds-button_brand">
<lightning:icon size="x-small" iconName="utility:copy_to_clipboard" variant="inverse"></lightning:icon>
<span> Upload Photos</span>
</span>
</sharinpix:UploadButtonCustom>
<!-- SharinPix Custom Upload Button end -->
</aura:component>
Click to copy
The content of the button needs to start with a <span> instead of an anchor <a> or <button> tag.
Attribute | Description | Data Type |
---|---|---|
recordId | Reference the recordId on which the images will be uploaded to | Salesforce Id |
permissionId |
Record ID or Name of the SharinPix Permission object to be applied on the Custom Upload Button component |
String |
enableToast | A toast will appear on upload completed | Boolean |
height | Height of the SharinPix Album component which displays the upload progression | integer (default: 400) |
enableImageSync | Activate image sync functionality | Boolean |
enableAction | Activate Tag action functionality | Boolean |
refreshView | Refresh various component on the lightning record when image sync or tag action has been performed | Boolean |
fileExtensions | File extensions that will be accepted only for upload. | String |
Link to LDS: https://www.lightningdesignsystem.com/components/buttons/
Note: you need to use a span instead of the link or button version for the component to work.
0 Comments
Add your comment