The Lightning output field component allows us to display the record view using the provided fields. You will need to enclose Lightning:outputfield in a wrapper component: Lightning:recordViewForm. The mandatory attributes for the recordViewForm are the recordId and the objectAPIName.
The syntax for the record view form is as follows:
<aura:component implements="force:hasRecordId,flexipage:availableForRecordHome"> <Lightning:recordViewForm recordId="{!v.recordId}" objectApiName="Contact"> <div class="slds-grid"> <div class="slds-col slds-size_1-of-2"> <!-- Your Lightning:outputField components here --> </div> <div class="slds-col slds-size_1-of-2"> <!-- More Lightning:outputField components here --> </div> </div> </Lightning:recordViewForm> </aura:component>
Note that in the real world, it is not recommended to use hardcoded ID values; instead, use the force:hasrecordId interface to provide the record ID.