Skip to content

Commit 3b329e9

Browse files
authored
docs(material/card): use better example for overview (#30868)
Currently the only example we show when the user lands on the docs for the card is a plain card with one line of text. These changes switch to using the "fancy" example which we weren't surfacing anywhere.
1 parent 15d39c5 commit 3b329e9

File tree

6 files changed

+22
-39
lines changed

6 files changed

+22
-39
lines changed

src/components-examples/material/card/card-fancy/card-fancy-example.html

-19
This file was deleted.

src/components-examples/material/card/card-fancy/card-fancy-example.ts

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1-
<mat-card appearance="outlined">
2-
<mat-card-content>Simple card</mat-card-content>
1+
<mat-card class="example-card" appearance="outlined">
2+
<mat-card-header>
3+
<div mat-card-avatar class="example-header-image"></div>
4+
<mat-card-title>Shiba Inu</mat-card-title>
5+
<mat-card-subtitle>Dog Breed</mat-card-subtitle>
6+
</mat-card-header>
7+
<img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu">
8+
<mat-card-content>
9+
<p>
10+
The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
11+
A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
12+
bred for hunting.
13+
</p>
14+
</mat-card-content>
15+
<mat-card-actions>
16+
<button matButton>LIKE</button>
17+
<button matButton>SHARE</button>
18+
</mat-card-actions>
319
</mat-card>
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import {ChangeDetectionStrategy, Component} from '@angular/core';
2+
import {MatButtonModule} from '@angular/material/button';
23
import {MatCardModule} from '@angular/material/card';
34

45
/**
5-
* @title Basic cards
6+
* @title Card overview
67
*/
78
@Component({
89
selector: 'card-overview-example',
910
templateUrl: 'card-overview-example.html',
10-
imports: [MatCardModule],
11+
styleUrl: 'card-overview-example.css',
12+
imports: [MatCardModule, MatButtonModule],
1113
changeDetection: ChangeDetectionStrategy.OnPush,
1214
})
1315
export class CardOverviewExample {}

src/components-examples/material/card/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export {CardFancyExample} from './card-fancy/card-fancy-example';
21
export {CardOverviewExample} from './card-overview/card-overview-example';
32
export {CardHarnessExample} from './card-harness/card-harness-example';
43
export {CardActionsExample} from './card-actions/card-actions-example';

0 commit comments

Comments
 (0)