Card

Create materialistic cards with various styles & formats with our card component.

Usage

Cards contain content and actions about a single subject. They are useful for displaying similar content in a well versed fashion. The parent of the content must have the card class attached to give access to the properties outlined below.

Basic card

Card subtitle

I am a basic card with a header, subtitle & content. You can use me to display basic content.

Notation:

  • Cards comprise of three different sections, all of which are prefixed with card. The card-header, card-body and the card-action, all of which are optional.
  • All cards (including large) are 100% width at mobile, filling the column or parent in which the card lies. They then become a fixed width at tablet screens & upwards.

Note: You can have any combination of the classes listed below.

<div class="card">
    <div class="card-content">
        <h3 class="card-title">Basic card</h3>
        <h5 class="card-subtitle">Card subtitle</h5>
        <p class="card-text">I am a basic card with a header, subtitle & content.</p>
    </div>
</div>Copy iconSuccess icon

Action

You can use actions within the card in conjunction with links & buttons. Add the card-action as a wrapper for any buttons or links.

Action card

Card subtitle

I am a simple card with a header, subtitle & basic card links.

<div class="card">
    <div class="card-content">
        <h3 class="card-title">Action card</h3>
        <h5 class="card-subtitle">Card subtitle</h5>
        <p class="card-text">I am a simple card with a header, subtitle & basic card links.</p>
    </div>
    <div class="card-action">
        <a href="#!" class="c-primary t-uppercase">Card link</a>
        <a href="#!" class="c-primary t-uppercase">Card link</a>
    </div>
</div>Copy iconSuccess icon

Button card

Card subtitle

I am a simple card with a header, subtitle & button.

<div class="card">
    <div class="card-content">
        <h3 class="card-title">Simple card</h3>
        <h5 class="card-subtitle">Card subtitle</h5>
        <p class="card-text">I am a simple card with a header, subtitle & button.</p>
    </div>
    <div class="card-action">
        <button class="btn btn-primary">Button</button>
    </div>
</div>Copy iconSuccess icon

Shadow

mesh automatically adds border to the cards, but if you fancy using shadow instead, go ahead! Just use the card-shadow class in conjunction with the card class.
This will get rid of any borders and add a materialistic box shadow.

Shadow card

Card subtitle

I am a simple card with a header, subtitle & basic card links.

<div class="card card-shadow">
    <div class="card-content">
        <h3 class="card-title">Shadow card</h3>
        <h5 class="card-subtitle">Card subtitle</h5>
        <p class="card-text">I am a simple card with a header, subtitle & basic card links.</p>
    </div>
    <div class="card-action">
        <a href="#!" class="c-primary t-uppercase">Card link</a>
        <a href="#!" class="c-primary t-uppercase">Card link</a>
    </div>
</div>Copy iconSuccess icon

Image

To use images within the card component, add the card-image class to contain the image.
Note: mesh does not calculate heights of the image, the width will always be the size of the card. If a set height is required, the object-fit: cover; property is recommended, whilst setting a width & height on the card-image element.

Circle & triangle background

Image card

I am an image card with an image, header & links.

<div class="card card-shadow">
    <div class="card-image">
        <img src="...">
    </div>
    <div class="card-content">
        <h3 class="card-title">Image card</h3>
        <p class="card-text">I am an image card with an image, header & links.</p>
    </div>
    <div class="card-action">
        <a href="#!" class="c-primary t-uppercase">Card link</a>
        <a href="#!" class="c-primary t-uppercase">Card link</a>
    </div>
</div>Copy iconSuccess icon

Large card:

To make the card wider, simply add card-large class in conjunction with the card class.
Note: you can add the card-large class to any card.

Circle & triangle background

Large Image card

I am a large image card with an image, header & links.

<div class="card card-large card-shadow">
    <div class="card-image">
        <img src="...">
    </div>
    <div class="card-content">
        <h3 class="card-title">Image card</h3>
        <p class="card-text">I am an image card with an image, header & links.</p>
    </div>
    <div class="card-action">
        <a href="#!" class="c-primary t-uppercase">Card link</a>
        <a href="#!" class="c-primary t-uppercase">Card link</a>
    </div>
</div>Copy iconSuccess icon

fab

FAB stands for Floating Action Button, they are used to add user interaction to a card effectively. To use the FAB button, add the card-icon class, which will make the icon absolutely positioned within the card-image element.
Note: The following classes need to be used in order for the FAB button to appear like below - btn btn-{color} btn-justicon br-circle.
You can also use any font awesome icon.

FAB card

I am an image card with an action icon in the centre.

<div class="card card-shadow">
    <div class="card-image">
        <img src="..">
        <a href="#!" class="card-icon btn btn-primary btn-justicon br-circle c-white">
            <i class="far fa-plus"></i>
        </a>
    </div>
    <div class="card-content">
        <h3 class="card-title">Icon card</h3>
        <p class="card-text">I am an image card with an action icon in the centre.</p>
    </div>
</div>Copy iconSuccess icon

Large FAB:

To make the FAB a little bigger, simply add btn-large class to the a link. You can also use a button if you prefer.

Large FAB card

I am an image card with an large action icon in the centre.

<div class="card card-shadow">
    <div class="card-image">
        <img src="..">
        <a href="#!" class="card-icon btn btn-primary btn-large btn-justicon br-circle c-white">
            <i class="far fa-plus"></i>
        </a>
    </div>
    <div class="card-content">
        <h3 class="card-title">Icon card</h3>
        <p class="card-text">I am an image card with an large action icon in the centre.</p>
    </div>
</div>Copy iconSuccess icon

Background

To add an image as a full background, place an <img> tag straight after the enclosing card element, then add the card-background-img class to position the image centrally.
Note: You can achieve the following result almost entirely with our utility helpers, such as padding which gives more space on the y axis of these cards.

Circle & triangle background
Background card

A quote about design

“If you do good work for good clients, it will lead to other good work for other good clients. If you do bad work for bad clients, it will lead to other bad work for other bad clients." Michael Bierut

Card link
<div class="card card-shadow t-center c-white py-4">
    <img class="card-background-img" src="...">
    <div class="card-content">
        <h6 class="t-uppercase">Background card</h6>
        <h3 class="card-title">A quote about design</h3>
        <p class="card-text">“If you do good work for good clients, it will lead to other good work for other good clients. If you do bad work for bad clients, it will lead to other bad work for other bad clients." <i>Michael Bierut</i></p>
        <a href="#!" class="btn btn-secondary c-white mt-2">Card link</a>
    </div>
</div>Copy iconSuccess icon

Large background card:

To make the background card a little bigger, simply add card-large class to the card element.

Circle & triangle background
Background card

A quote about design

“To design is much more than simply to assemble, to order, or even to edit: it is to add value and meaning, to illuminate, to simplify, to clarify, to modify, to dignify, to dramatize, to persuade, and perhaps even to amuse. To design is to transform prose into poetry.” Paul Rand

Card link
<div class="card card-large card-shadow t-center c-white py-4">
    <img class="card-background-img" src="...">
    <div class="card-content">
        <h6 class="t-uppercase">Background card</h6>
        <h3 class="card-title">A quote about design</h3>
        <p class="card-text">“If you do good work for good clients, it will lead to other good work for other good clients. If you do bad work for bad clients, it will lead to other bad work for other bad clients." <i>Michael Bierut</i></p>
        <a href="#!" class="btn btn-secondary c-white mt-2">Card link</a>
    </div>
</div>Copy iconSuccess icon

Variants

There are endless possibilities with using mesh cards, in different order, sizes, colors and more. Here are a couple of examples:

100% width

To override the default fixed width of the mesh card simply add the w-100 class to the card element.
This will fill the width of the parent, great if you want to use it in columns.

100% width card

Card subtitle

I am a card that stretches 100% to fit my parent.

100% width card

Card subtitle

I am a card that stretches 100% to fit my parent.

<div class="row">
    <div class="col-6">
        <div class="card w-100">
            <div class="card-content">
                <h3 class="card-title">100% width card</h3>
                <h5 class="card-subtitle">Card subtitle</h5>
                <p class="card-text">I am a card that stretches 100% to fit my parent.</p>
            </div>
        </div>
    </div>
</div>
<div class="col-6">
    <div class="card w-100">
        <div class="card-content">
            <h3 class="card-title">100% width card</h3>
            <h5 class="card-subtitle">Card subtitle</h5>
            <p class="card-text">I am a card that stretches 100% to fit my parent.</p>
        </div>
    </div>
</div>Copy iconSuccess icon

Card panel

To have a simple card panel with a text filler, just use the card-content class with the card-text class as a child, see below.

A 24 year old boy seeing out from the train’s window shouted… “Dad, look the trees are going behind!” Dad smiled and a young couple sitting nearby, looked at the 24 year old’s childish behavior with pity, suddenly he again exclaimed… “Dad, look the clouds are running with us!” The couple couldn’t resist and said to the old man… “Why don’t you take your son to a good doctor?” The old man smiled and said…“I did and we are just coming from the hospital, my son was blind from birth, he just got his eyes today.” Every single person on the planet has a story. Don’t judge people before you truly know them. The truth might surprise you.

<div class="card card-large">
    <div class="card-content">
        <p class="card-text">A 24 year old boy seeing out from the train’s window ...</p>
    </div>
</div>Copy iconSuccess icon

Variables

Change padding, widths and border colors with the card variables.

Variable Value Description
$card-enable-fab-icon: true;
Boolean Enables/disables floating action buttons (FABs) on cards.
$card-enable-background-img: true;
Boolean Enables/disables full background image cards.
$card-default-width: 300px;
Pixel/em/rem Default card width in in pixels, em's or rem's.
$card-default-width-large: 400px;
Pixel/em/rem The large card width in pixels, em's or rem's.
$card-background-color: #fff;
Color The default background color of the card.
$card-border-color: rgba(0, 0, 0, 0.2);
Color The border color of the card.
$card-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
0 3px 1px -2px rgba(0, 0, 0, 0.2), 
0 1px 5px 0 rgba(0, 0, 0, 0.12);
Color The shadow of the card when enabled via the shadow class.
$card-default-padding: 12px 30px;
Pixel/em/rem Padding amount for default cards in pixels, em's or rem's.
$card-header-padding: 12px 24px;
Pixel/em/rem Padding amount for the header section of the card (top) in pixels, em's or rem's.
$card-content-padding: 24px;
Pixel/em/rem Padding amount for the content section of the card (middle) in pixels, em's or rem's.
$card-action-padding: 16px 24px;
Pixel/em/rem Padding amount for the action section of the card (bottom) in pixels, em's or rem's.
$card-margin: 0.5rem 0 1rem 0;
Pixel/em/rem Margin amount for the card in pixels, em's or rem's.