Skip to main content

fast-card

The fast-card component is a visual container without semantics that takes children. Cards are snapshots of content that are typically used in a group to present collections of related information.

Setup

import {
provideFASTDesignSystem,
fastCard
} from "@microsoft/fast-components";

provideFASTDesignSystem()
.register(
fastCard()
);

Usage

Live Editor
Result
Loading...

Create your own design

import {
Card,
cardTemplate as template,
} from "@microsoft/fast-foundation";
import { cardStyles as styles } from "./my-card.styles";

export const myCard = Card.compose({
baseName: "card",
template,
styles,
});

API

class: Card

Superclass

NameModulePackage
FoundationElement/src/foundation-element/foundation-element.js

Fields

NamePrivacyTypeDefaultDescriptionInherited From
$presentationpublicComponentPresentation or nullA property which resolves the ComponentPresentation instance for the current component.FoundationElement
templatepublicElementViewTemplate or void or nullSets the template of the element instance. When undefined, the element will attempt to resolve the template from the associated presentation or custom element definition.FoundationElement
stylespublicElementStyles or void or nullSets the default styles for the element instance. When undefined, the element will attempt to resolve default styles from the associated presentation or custom element definition.FoundationElement

Methods

NamePrivacyDescriptionParametersReturnInherited From
templateChangedprotectedvoidFoundationElement
stylesChangedprotectedvoidFoundationElement

Slots

NameDescription
The default slot for the card content

Additional resources