You can use the lightning:layout
and lightning:layoutItem
to achieve the SLDS grid.
<lightning:layout >
<lightning:layoutItem >
<lightning:input name="input1" label="First Name"/>
</lightning:layoutItem>
<lightning:layoutItem >
<lightning:input name="input2" label="Last Name"/>
</lightning:layoutItem>
</lightning:layout>
If you're looking for a read-only record layout, Winter '18 comes with lightning:outputField
, where you can do something like this.
<lightning:recordViewForm recordId="003R0000001b5x1IAA" objectApiName="Contact">
<div class="slds-box slds-theme_default">
<lightning:layout class="slds-p-around--large">
<lightning:layoutItem >
<lightning:outputField fieldName="Name" />
<lightning:outputField fieldName="Phone"/>
<lightning:outputField fieldName="Email" />
</lightning:layoutItem>
<lightning:layoutItem class="slds-p-around--large">
<lightning:outputField fieldName="Birthdate" />
<lightning:outputField fieldName="LeadSource" />
</lightning:layoutItem>
</lightning:layout>
</div>
</lightning:recordViewForm>
lightning:input
component which is an input field and in the standard layout you have a read only field only if you click on the pencil you get the edit mode. To achieve this behavior you can use a standardRelated Record
component that it'sUpdate Action
is an Update Action of the object