lightning:fileCard

Displays a preview of an uploaded file available in Salesforce CRM Content or Salesforce Files.

A lightning:fileCard component displays a preview of a file. On desktops, clicking the file preview opens the SVG file preview player, enabling you to preview images, documents, and other files in the browser. The file preview player provides quick access to file actions, such as upload, delete, download, and share. On mobile devices, clicking the file preview downloads the file. If a title is available, it's displayed below the file preview in the caption area. The file type determines the icon used on the file preview and caption area.

This component inherits styling from files in the Lightning Design System.

Here's an example of a file preview. The fileId value must be a valid 15 character ContentDocument ID.

<aura:component>
    <lightning:fileCard fileId="069XXXXXXXXXXXX"/>
</aura:component>
Usage Considerations

Opening the file preview player is supported in Lightning Experience, the Salesforce mobile web, and Lightning communities.

Attributes

Attribute Name Attribute Type Description Required?
body Component[] The body of the component. In markup, this is everything in the body of the tag.
fileId String The Salesforce File ID (ContentDocument). Yes