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" />
    <!-- SharinPix Custom Upload Button start -->
    <sharinpix:UploadButtonCustom recordId="{!v.recordId}" enableToast="true" enableImageSync="true" enableAction="true" height="500" refreshView="true">
        <span class="slds-button slds-button_brand">
            <lightning:icon size="x-small" iconName="utility:copy_to_clipboard" variant="inverse"></lightning:icon>
            <span>&nbsp;&nbsp;Upload Photos</span>
        </span>
    </sharinpix:UploadButtonCustom>
    <!-- SharinPix Custom Upload Button end -->
</aura:component>

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
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

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

E-Mail me when someone replies to this comment