Represents a read-only display of a value for a field on a Salesforce object. This component respects the attributes of the associated field and how it should be displayed. For example, if the component contains a date and time value, then the default output value contains the date and time in the user's locale. Bind the field using the value attribute and provide a default value to initialize the object.
<aura:attribute name="contact" type="Contact" default="{ 'sobjectType': 'Contact'}"/> <force:outputField aura:id="contactName" value="{!v.contact.Name}"/>
Use a different output component such as ui:outputText if you're working with user input that does not correspond to a field on a Salesforce object.
Attribute Name | Attribute Type | Description | Required? |
---|---|---|---|
body | Component[] | The body of the component. In markup, this is everything in the body of the tag. | |
class | String | A CSS style to be attached to the component. This style is added in addition to base styles output by the component. | |
value | Object | Data value of Salesforce field to which to bind. |