Component
Expression
HTML
If
Iteration
Render If (Deprecated)
Template
Text
Unescaped HTML
LWC Developer Guide
SLDS 1
SLDS 2
aura:renderIf
Conditionally renders the contents provided in its body if isTrue evaluates to true. Use the else attribute to render an alternative when isTrue evaluates to false.
This event is deprecated. Use aura:if instead.
For Use In
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App
The expression in isTrue is re-evaluated every time any value used in the expression changes. When the results of the expression change, it triggers a re-rendering of the component. Use aura:renderIf if you expect to show the components for both the true and false states, and it would require a server round trip to instantiate the components that aren’t initially rendered. Switching condition unrenders current branch and renders the other. Otherwise, use aura:if instead if you want to instantiate the components in either its body or the else attribute, but not both.
1<aura:component>
2 <aura:renderIf isTrue="{!v.truthy}">
3 True
4 <aura:set attribute="else">
5 False
6 </aura:set>
7 </aura:renderIf>
8</aura:component>| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| else | The alternative content to render when isTrue evaluates to false, and the body is not rendered. Set using the <aura:set> tag. | Aura.Component[] | ||
| isTrue | An expression that must evaluate to true to display the body of the component. | Boolean |