lwc card code example

Example 1: salesforce lightning card

<lightning:card footer="Card Footer" title="Hello">
        <aura:set attribute="actions">
            <lightning:button label="New"/>
        </aura:set>
        <p class="slds-p-horizontal_small">
            Card Body (custom component)
        </p>
    </lightning:card>

Example 2: lwc card

<template>
    <lightning-card
            variant="narrow"
            icon-name="standard:opportunity">
        <h1 slot="title">Hello title</h1>
        <p class="slds-p-horizontal_small">This is body. You can have your content here</p>
        <div slot="actions">
            <lightning-button label="New" slot="actions"></lightning-button>
        </div>
        <div slot="footer">
            <p>Contact Us SFDCPoint</p>
        </div>
    </lightning-card>
</template>

Tags:

Misc Example