Skip to content

Instantly share code, notes, and snippets.

@waltonzt
Last active January 9, 2019 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waltonzt/5f9354d9b21d8831adae2bf0f0c02e2a to your computer and use it in GitHub Desktop.
Save waltonzt/5f9354d9b21d8831adae2bf0f0c02e2a to your computer and use it in GitHub Desktop.

Lightning Components

lightning:card

<div class="slds-card">
</div>

Close Quick Actions

$A.get("e.force:closeQuickAction").fire()

Refresh Screen

$A.get('e.force:refreshView').fire();

Lightning Design System

Alignment

slds-align_absolute-center

Margin

slds-m-top_small
slds-m-right_small

xxx-small to xx-large

Padding

slds-p-top_small
slds-p-right_small

xxx-small to xx-large

Toast

showToast : function(title, message, type) {
  var toastEvent = $A.get('e.force:showToast');
  toastEvent.setParams({
    'title': title,
    'message' : message,
    'type' : type
  });
  toastEvent.fire();
}

If Statement

<aura:if isTrue="{!v.edit}">
    <ui:button label="Edit"/>
    <aura:set attribute="else">
        You can’t edit this.
    </aura:set>
</aura:if>

Links

Lightning Components Developer Guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment