Record View

force:recordView

Generates a view of the specified Salesforce record.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App

This component has been superseded by lightning:recordViewForm. Alternatively, use lightning:recordForm if you want to switch between view and edit modes easily.

A force:recordView component represents a read-only view of a record. By default, the record view uses the full layout to display all fields of the record. The type attribute does not support any other value so you don’t need to specify it. Previous versions of this document incorrectly stated that force:recordView could display the compact layout.

If you want granular control over displaying of specific fields, we recommend using lightning:recordViewForm with lightning:outputField instead.

This example shows a record view with a full layout.

You can provide a dynamic ID for the recordId attribute using the format {!v.myObject.recordId}. To load record data, wire up the container component to an Apex controller that returns the data. See Working with Salesforce Data in the Lightning Aura Components Developer Guide for more information.

This component doesn't fully use the Lightning Design System styling. The layout elements use Lightning Design System styling, but the input fields do not. Use lightning:recordViewForm if you want a component that inherits the Lightning Design System styling.