MatCard
Themat-card is a content container component that provides Material Design styling and layout for cards. Cards contain content and actions about a single subject.
Basic Usage
API Reference
MatCard
Selector:mat-card
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
appearance | MatCardAppearance | 'raised' | Card appearance style |
MatCardHeader
Selector:mat-card-header
Container for card header content including title, subtitle, and avatar.
MatCardTitle
Selector:mat-card-title, [mat-card-title], [matCardTitle]
Title element for a card.
MatCardSubtitle
Selector:mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]
Subtitle element for a card.
MatCardContent
Selector:mat-card-content
Container for main card content.
MatCardActions
Selector:mat-card-actions
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
align | 'start' | 'end' | 'start' | Position of the actions inside the card |
MatCardFooter
Selector:mat-card-footer
Container for card footer content.
MatCardTitleGroup
Selector:mat-card-title-group
Container for title, subtitle, and content image.
MatCardImage
Selector:[mat-card-image], [matCardImage]
Primary image content for a card.
MatCardSmImage
Selector:[mat-card-sm-image], [matCardImageSmall]
Small image for a card.
MatCardMdImage
Selector:[mat-card-md-image], [matCardImageMedium]
Medium image for a card.
MatCardLgImage
Selector:[mat-card-lg-image], [matCardImageLarge]
Large image for a card.
MatCardXlImage
Selector:[mat-card-xl-image], [matCardImageXLarge]
Extra-large image for a card.
MatCardAvatar
Selector:[mat-card-avatar], [matCardAvatar]
Avatar image for a card header.
Examples
Card with Image
Card with Avatar
Card with Actions Aligned End
Card Appearances
Card Title Group
Card Grid Layout
Card with Footer
Accessibility
Cards are primarily visual containers and do not have specific ARIA roles by default. Add appropriate roles and labels based on your use case:Styling
Custom Card Styles
Card Spacing
Types
MatCardAppearance
MatCardConfig
Injection Tokens
MAT_CARD_CONFIG
Best Practices
- Keep content focused: Cards should represent a single topic or subject
- Use consistent layouts: Maintain consistent card structure across your app
- Limit actions: Include 1-2 primary actions per card
- Responsive sizing: Ensure cards work well on different screen sizes
- Appropriate images: Use proper image sizes and aspect ratios