BlogPlaygroundOne

Cards

The v-card component is a versatile and enhanced version of v-sheet that provides a simple interface for headings, text, images, icons, and more.

Usage

The v-card component is a stylish way to wrap different types of content; such as tables, images, or user actions.

Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ratione debitis quis est labore voluptatibus! Eaque cupiditate minima, at placeat totam, magni doloremque veniam neque porro libero rerum unde voluptatem!
<v-card text="..."></v-card>
ads via vuetify

API

ComponentDescription
v-cardPrimary Component
v-card-itemSub-component used to wrap the Card’s v-card-title and v-card-subtitle components.
v-card-titleSub-component used to display the Card’s title. Wraps the #title slot
v-card-subtitleSub-component used to display the Card’s subtitle. Wraps the #subtitle slot.
v-card-textSub-component used to display the Card’s text. Wraps the #text slot.
v-card-actionsSub-component that modifies the default styling of v-btn. Wraps the #actions slot
Toggle Inline API

Anatomy

The recommended placement of elements inside of v-card is:

  • Place v-card-title, v-card-subtitle or other title text on top
  • Place v-card-text and other forms of media below the card header
  • Place v-card-actions after card content

Element / AreaDescription
1. ContainerThe Card container holds all v-card components. Composed of 3 major parts: v-card-item, v-card-text, and v-card-actions
2. Title (optional)A heading with increased font-size
3. Subtitle (optional)A subheading with a lower emphasis text color
4. Text (optional)A content area with a lower emphasis text color
5. Actions (optional)A content area that typically contains one or more v-btn components

Guide

The v-card component is a versatile and enhanced sheet of paper that provides a simple interface for headings, text, images, and actions. It is a content container that is the most common way to present information.

Basics

There are three ways you can populate a v-card with content. The first one is by using props, the second one is by slots, and the third one is by manually using the v-card-* components.

This is a title
This is a card subtitle
Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ratione debitis quis est labore voluptatibus!
Using Props Only
This is a title
This is a card subtitle
Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ratione debitis quis est labore voluptatibus!
Using Slots Only
This is a title
This is a card subtitle
Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ratione debitis quis est labore voluptatibus!
Using Markup Only

Props give you an easy interface to display text-only content. They can also be used to easily render images and icons. Use slots if you need to render more complex content. If you need full control over the content, use markup.

Combined

In some cases it is possible to combine the different options, like the example below where props, slots and markup have all been used.

Welcome to Vuetify
The #1 Vue UI Library
Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ratione debitis quis est labore voluptatibus! Eaque cupiditate minima, at placeat totam, magni doloremque veniam neque porro libero rerum unde voluptatem!

Props

The v-card component has a variety of props that allow you to customize its appearance and behavior.

Variants

The variant prop gives you easy access to several different card styles. Available variants are: elevated(default), flat, tonal, outlined, text, and plain.

ValueDescription
elevatedElevates the card with a shadow
flatRemoves card shadow and border
tonalBackground color is a lowered opacity of the color
outlinedApplies a thin border and card has zero elevation
textRemoves the background and removes shadow
plainRemoves the background and lowers the opacity until hovered
Headline
Greyhound divisely hello coldly fonwderfully
elevated
Headline
Greyhound divisely hello coldly fonwderfully
flat
Headline
Greyhound divisely hello coldly fonwderfully
tonal
Headline
Greyhound divisely hello coldly fonwderfully
outlined
Headline
Greyhound divisely hello coldly fonwderfully
text
Headline
Greyhound divisely hello coldly fonwderfully
plain
ads via vuetify

Color

Cards can be colored by using any of the builtin colors and contextual names using the color prop.

elevated
Headline
Greyhound divisely hello coldly fonwderfully
flat
Headline
Greyhound divisely hello coldly fonwderfully
tonal
Headline
Greyhound divisely hello coldly fonwderfully
outlined
Headline
Greyhound divisely hello coldly fonwderfully

Elevation

The elevation property provides up to 24 levels of shadow depth. By default, cards rest at 2dp.

Card title
Card subtitle secondary text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Hover

When using the hover prop, the cards will increase its elevation when the mouse is hovered over them.

Card title
Card subtitle secondary text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Href

The card becomes an anchor with the href prop.

Disabled

The disabled prop can be added in order to prevent a user from interacting with the card.

Disabled card
The card stays disabled

Image

Apply a specific background image to the Card.

Evening sunset
Take a walk down the beach

Slots

The v-card component provides slots that enable you to customize content created by its props or to add additional content.

Slots give you greater control to customize the content of the v-card component while still taking advantage of the easy-to-use props.

Avatar and icon

You can use the prepend-avatar, append-avatar, prepend-icon and append-icon props or the prepend and append slots to place a v-icon that automatically injects the designated icon.

Icons
prepend-icon and append-icon
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.
Icons
prepend and append
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.
Avatars
prepend-avatar and append-avatar
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.
Avatars
prepend and append
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.

Examples

The following are a collection of examples that demonstrate more advanced and real world use of the v-card component.

Card Reveal

Using v-expand-transition and a @click event you can have a card that reveals more information once the button is clicked, activating the hidden card to be revealed.

Word of the Day
el·ee·mos·y·nar·y
adjective
relating to or dependent on charity; charitable; charitable donations. Pertaining to alms.
"an eleemosynary educational institution."

Content wrapping

The v-card component is useful for wrapping content.

Messages
Today
You @10:42am
Sure, I'll see you later.
John Doe @10:37am
Yeah, sure. Does 1:00pm work?
You @9:47am
Did you still want to grab lunch today?

Custom actions

With a simple conditional, you can easily add supplementary text that is hidden until opened.

Top western road trips
1,000 miles of wonder
I'm a thing. But, like most politicians, he promised more than he could deliver. You won't have time for sleeping, soldier, not with all the bed making you'll be doing. Then we'll go with that data file! Hey, you add a one and two zeros to that or we walk! You're going to do his laundry? I've got to find a way to escape.
ads via vuetify

Grids

Using grids, you can create beautiful layouts.

Pre-fab homes
Favorite road trips
Best airlines

Horizontal cards

You can also play with the card layout using layout flex.

My Music
Unlimited music now
Listen to your favorite artists and albums whenever and wherever, online and offline.
Supermodel
Foster the People
Halcyon Days
Ellie Goulding

Information card

Cards are entry points to more detailed information. To keep things concise, ensure to limit the number of actions the user can take.

Word of the Day
be•nev•o•lent
adjective
well meaning and kindly.
"a benevolent smile"

Media with text

Using the layout system, we can add custom text anywhere within the background.

Top 10 Australian beaches
Number 10
Whitehaven Beach
Whitsunday Island, Whitsunday Islands

Twitter card

The v-card component has multiple children components that help you build complex examples without having to worry about spacing. This example is comprised of the v-card-title, v-card-text and v-card-actions components.

Twitter
"Turns out semicolon-less style is easier and safer in TS because most gotcha edge cases are type invalid as well."
Evan You
Vue Creator
256·45

Weather card

Using v-list-items and a v-slider, we are able to create a unique weather card. The list components ensure that we have consistent spacing and functionality while the slider component allows us to provide a useful interface of selection to the user.

Florida
Extreme Weather Alert
64°F
123 km/h
48%

Loading

Use an indeterminate v-progress-linear to indicate a loading state.

Cafe Badilico
Local Favorite
4.5 (413)
$ • Italian, Cafe
Small plates, salads & sandwiches - an intimate setting with 12 indoor seats plus patio seating.
Tonight's availability
5:30PM
7:30PM
8:00PM
9:00PM

Earnings goal

This example utilizes slots to customize the appearance of the different content areas.

🎯
Set an earnings goal.
Earn my first $100
0%
$0 of $100 earned — 7 days left

Funding card

Utilize a combination of Card properties and utility classes to create a unique funding card.

Progress
90%
$2,938.00 remaining
Eligibility review
$26,442.00 remitted $29,380.00 total

Ready for more?

Continue your learning with related content selected by the Team or move between pages by using the navigation links below.