|
| 1 | +<div fxLayout="column" fxLayoutAlign="start start" class="mdc-padding"> |
| 2 | + <h1 mdc-typography-display1>Cards</h1> |
| 3 | + <p mdc-typography-subheading2>The MDC Card component is a sheet of material that serves as an entry point to more detailed information.</p> |
| 4 | + <a href="https://github.com/material-components/material-components-web/tree/master/packages/mdc-card">Google Material Components documentation</a> |
| 5 | + <h1 mdc-typography-headline>Usage</h1> |
| 6 | + <div> |
| 7 | + <pre class="prettyprint"><![CDATA[import { CardModule } from '@angular-mdc/web';]]></pre> |
| 8 | + </div> |
| 9 | + <h1 mdc-typography-headline>Selectors - More usage guide info to come.</h1> |
| 10 | + <div> |
| 11 | + <pre class="prettyprint">mdc-card</pre> |
| 12 | + <pre class="prettyprint">mdc-card-horizontal</pre> |
| 13 | + <pre class="prettyprint">mdc-card-primary</pre> |
| 14 | + <pre class="prettyprint">mdc-card-supporting-text</pre> |
| 15 | + <pre class="prettyprint">mdc-card-title</pre> |
| 16 | + <pre class="prettyprint">mdc-card-subtitle</pre> |
| 17 | + <pre class="prettyprint">mdc-card-media</pre> |
| 18 | + <pre class="prettyprint">mdc-card-media-item</pre> |
| 19 | + <pre class="prettyprint">mdc-card-actions</pre> |
| 20 | + </div> |
| 21 | + <div fxLayout="row" fxLayout.lt-md="column"> |
| 22 | + <div fxLayout="column"> |
| 23 | + <h1 mdc-typography-headline>API reference</h1> |
| 24 | + <table> |
| 25 | + <thead> |
| 26 | + <tr> |
| 27 | + <th>Attribute</th> |
| 28 | + <th></th> |
| 29 | + </tr> |
| 30 | + </thead> |
| 31 | + <tbody> |
| 32 | + <tr> |
| 33 | + <td><pre class="prettyprint">@Input() darkTheme: boolean</pre></td> |
| 34 | + <td>Apply dark theme directly to the card.</td> |
| 35 | + </tr> |
| 36 | + <tr> |
| 37 | + <td><pre class="prettyprint">@Input() titleLarge: boolean</pre></td> |
| 38 | + <td>An option to make the title larger. (default is true)</td> |
| 39 | + </tr> |
| 40 | + <tr> |
| 41 | + <td><pre class="prettyprint">@Input() vertical: boolean</pre></td> |
| 42 | + <td>Option to lay actions out vertically instead of horizontally.</td> |
| 43 | + </tr> |
| 44 | + </tbody> |
| 45 | + </table> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + <h1 mdc-typography-headline>Examples</h1> |
| 49 | + <div fxLayout="row" fxLayout.lt-md="column" fxLayoutWrap fxLayoutGap="40px" fxLayoutAlign="start start"> |
| 50 | + <mdc-card> |
| 51 | + <mdc-card-primary> |
| 52 | + <h1 mdc-card-title>Title</h1> |
| 53 | + <h2 mdc-card-subtitle>Subtitle</h2> |
| 54 | + </mdc-card-primary> |
| 55 | + <mdc-card-actions> |
| 56 | + <button mdc-button [cardAction]="true">Action 1</button> |
| 57 | + <button mdc-button [cardAction]="true">Action 2</button> |
| 58 | + </mdc-card-actions> |
| 59 | + </mdc-card> |
| 60 | + |
| 61 | + <mdc-card class="demo-card"> |
| 62 | + <mdc-card-primary> |
| 63 | + <h1 mdc-card-title>Title</h1> |
| 64 | + <h2 mdc-card-subtitle>Subtitle</h2> |
| 65 | + </mdc-card-primary> |
| 66 | + <mdc-card-supporting-text>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</mdc-card-supporting-text> |
| 67 | + <mdc-card-actions> |
| 68 | + <button mdc-button [cardAction]="true">Action 1</button> |
| 69 | + <button mdc-button [cardAction]="true">Action 2</button> |
| 70 | + </mdc-card-actions> |
| 71 | + </mdc-card> |
| 72 | + |
| 73 | + <mdc-card [darkTheme]="true" [ngClass]="{'mdc-theme--dark demo-card' : true}"> |
| 74 | + <mdc-card-primary> |
| 75 | + <h1 mdc-card-title [titleLarge]="true">Title</h1> |
| 76 | + <h2 mdc-card-subtitle>Subtitle</h2> |
| 77 | + </mdc-card-primary> |
| 78 | + <mdc-card-actions> |
| 79 | + <button mdc-button [cardAction]="true">Action 1</button> |
| 80 | + <button mdc-button [cardAction]="true">Action 2</button> |
| 81 | + </mdc-card-actions> |
| 82 | + </mdc-card> |
| 83 | + |
| 84 | + <mdc-card class="demo-card"> |
| 85 | + <mdc-card-horizontal> |
| 86 | + <mdc-card-primary> |
| 87 | + <h1 mdc-card-title>Title</h1> |
| 88 | + <h2 mdc-card-subtitle>Subtitle</h2> |
| 89 | + </mdc-card-primary> |
| 90 | + <img mdc-card-media-item [size]="2" src="https://material-components-web.appspot.com/images/1-1.jpg"/> |
| 91 | + </mdc-card-horizontal> |
| 92 | + <mdc-card-actions> |
| 93 | + <button mdc-button [cardAction]="true">Action 1</button> |
| 94 | + <button mdc-button [cardAction]="true">Action 2</button> |
| 95 | + </mdc-card-actions> |
| 96 | + </mdc-card> |
| 97 | + |
| 98 | + <mdc-card> |
| 99 | + <mdc-card-horizontal> |
| 100 | + <img mdc-card-media-item [size]="3" src="https://material-components-web.appspot.com/images/1-1.jpg" /> |
| 101 | + <mdc-card-actions [vertical]="true"> |
| 102 | + <button mdc-button [cardAction]="true">Action 1</button> |
| 103 | + <button mdc-button [cardAction]="true">Action 2</button> |
| 104 | + </mdc-card-actions> |
| 105 | + </mdc-card-horizontal> |
| 106 | + </mdc-card> |
| 107 | + |
| 108 | + <mdc-card class="demo-card"> |
| 109 | + <mdc-card-media [ngClass]="{'demo-card__16-9-media' : true}"></mdc-card-media> |
| 110 | + <mdc-card-primary class="test"> |
| 111 | + <h1 mdc-card-title>Title</h1> |
| 112 | + <h2 mdc-card-subtitle>Subtitle</h2> |
| 113 | + </mdc-card-primary> |
| 114 | + <mdc-card-actions> |
| 115 | + <button mdc-button [cardAction]="true">Action 1</button> |
| 116 | + <button mdc-button [cardAction]="true">Action 2</button> |
| 117 | + </mdc-card-actions> |
| 118 | + </mdc-card> |
| 119 | + |
| 120 | + <mdc-card class="demo-card"> |
| 121 | + <mdc-card-primary> |
| 122 | + <div class="demo-card__avatar"></div> |
| 123 | + <h1 mdc-card-title>Title</h1> |
| 124 | + <h2 mdc-card-subtitle>Subtitle</h2> |
| 125 | + </mdc-card-primary> |
| 126 | + <mdc-card-media [ngClass]="{'demo-card__16-9-media' : true}"></mdc-card-media> |
| 127 | + <mdc-card-actions> |
| 128 | + <button mdc-button [cardAction]="true">Action 1</button> |
| 129 | + <button mdc-button [cardAction]="true">Action 2</button> |
| 130 | + </mdc-card-actions> |
| 131 | + </mdc-card> |
| 132 | + </div> |
| 133 | +</div> |
0 commit comments