A grouping of related information associated with a record.
For Use In
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App, Mobile Offline
A lightning-tile component groups related information associated with a
record. The information can be actionable and paired with a figure, such as a
lightning-icon or lightning-avatar component.
Use the class attributes to customize the styling. To style the tile
body, use the Lightning Design System utility classes.
This component implements styling from
tiles in the
Lightning Design System.
To insert an icon or avatar, pass it into the media slot. You can
create a tile with an icon using definition lists. This example aligns an icon
and some text using utility classes like slds-dl_horizontal.
You can also create a list of tiles with avatars using an unordered list.
This example places tiles in a list and creates dividers using utility classes
like slds-has-dividers_bottom-space.
Use the detail property to return the action that was triggered.
1import{LightningElement, track}from "lwc";23export default class DemoTileAction extends LightningElement{4 @track actions = [5{label: "Edit", value: "edit", iconName: "utility:edit"},6{label: "Delete", value: "delete", iconName: "utility:delete"},7];89 handleAction(event){10 // Get the value of the selected action11 const tileAction = event.detail.action.value;12}13}
Design Guidelines
A tile requires a label and can include a supporting icon or avatar, and additional elements. You interact with elements within the tile, such as buttons and links, not the tile as a whole. Data is presented as label-value pairs. The user interacts with elements within the tile, such as buttons and links, not the tile as a whole.
Use tiles when you are horizontally constrained for space. Tiles are appropriate for short lists, using a <ul> or <dl> for example, that are fewer than 10 items. Tile layouts do not stretch well, so to use available horizontal space, add a column of tiles. On wider screens where more than 2 columns of tiles will appear, tile lists should elegantly and responsively expand into tables.
Usage Considerations
Icons are not available in Lightning Out, but they are available in Lightning Components for Visualforce and other experiences.