Skip to content

[md-card] Add md-card-header (similar to md-card-footer) #1650

Closed
@ghost

Description

Feature request

Add a md-card-header, similar to md-card-footer, but on top of the md-card.

What is the expected behavior?

I would expect a md-card-header, so that we can place something inside a md-card, but on top, without any padding.

What is the current behavior?

md-card partially supports this with md-card-footer, but it is limited to the bottom of the md-card

What is the use-case or motivation for changing an existing behavior?

The use-case for this came to my mind when I was trying to make a md-card similar to this (example taken from the md-input documentation)

I.e. I wanted to have a md-card, with a md-toolbar as header. If I copy/paste the code given for this example, the md-toolbar would (of course) appear with a padding. We would have to apply custom css styles to make something similar. I think that it's a quite common use-case for a md-card to have a md-toolbar as title, so I would suggest to add a md-card-header, so that we can apply an element to the md-card-header, ignoring the paddings.

I think that this could easily be implemented, since it is quite similar to the md-card-footer.

Note

I know that one could just change the markup to something like this:

<md-toolbar color="primary">Basic</md-toolbar>
<md-card>
    <!-- content... -->
</md-card>

The problem with this approach is, that the md-toolbar then would have no box-shadow, which doesn't look that good. Applying a shadow to the md-toolbar would not only be redundant, but the shadow would also overlap with the md-card

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions