1c2a3f1 Sep 22, 2016
@Nightapes @hansl
116 lines (84 sloc) 3.27 KB


md-card is a content container component that conforms to the spec of a Material Design card.

See plunker example here.


Simply add your content between md-card tags to consume basic card styles like box-shadow and default padding.

   Basic card.


Preset sections

We also provide a number of preset sections that you can mix and match within the md-card tags.

  • <md-card-title>: adds styles for a title
  • <md-card-subtitle>: adds styles for a subtitle
  • <md-card-content>: main content section, intended for blocks of text
  • <img md-card-image>: stretches image to container width
  • <md-card-actions>: wraps and styles buttons
  • <md-card-footer>: anchors section to bottom of card (e.g progress bar)

Example markup for a card with section presets:

   <md-card-subtitle>Subtitle first</md-card-subtitle>
   <md-card-title>Card with title</md-card-title>   
        <p>This is supporting text.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do 
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad</p>
        <button md-button>LIKE</button>
        <button md-button>SHARE</button>


Preset shortcuts

md-card-actions has a few layout shortcuts. You can add align="end" to align the buttons at the end of the main axis (flex-end). The default is align="start" (flex-start).

Preset layouts

You can also leverage preset layouts that format some of the sections together.


Formats the following sections into a header:

  • <md-card-title>: title to format within header
  • <md-card-subtitle>: subtitle to format within header
  • <img md-card-avatar>: image to use for avatar

Example markup for a card with a header:

      <img md-card-avatar src="path/to/img.png">
      <md-card-title>Header title</md-card-title>
      <md-card-subtitle>Header subtitle</md-card-subtitle>
   <img md-card-image src="path/to/img.png">
      <p>Here is some more content</p>



Groups the following sections together:

  • <md-card-title>: title to format within group
  • <md-card-subtitle>: subtitle to format within group
  • One of the following image sizes:
    • <img md-card-sm-image>
    • <img md-card-md-image>
    • <img md-card-lg-image>

Example markup for a card with title-group layout:

      <img md-card-sm-image src="path/to/img.png">
      <md-card-title>Card with title</md-card-title>