Vivid API

Card

A card is a UI design pattern that groups related information in a flexible-size container visually resembling a playing card

Usage

import { VCard } from '@vonage/vivid-api-vue';
import { registerCard } from '@vonage/vivid-api';
registerCard('your-prefix');

Slots

Body Slot

This is the slot for any content that you need to display after header content (Headline, Subtitle). It can be used instead of, or in conjunction with the text attribute.

Icon Slot

The icon slot is the preferred way to add an icon to the component. Use it to display an icon from the icon library.

Graphic Slot

Use the graphic slot for Icons or custom images. The graphic slot overrides the icon slot.

Media Slot

The media slot can be used to display images or video content above the card header.

Meta Slot

The meta slot is for action content in the card header.

The footer slot is for content in the card footer.
Use it for adding buttons or action items.
By default - items inside footer slot are aligned to the end.

Main Slot

Card has predefined content style template.
Use the main slot to fully override a card’s predefined template with your own. When using main - only appearance and elevation are applied on the card.

CSS Variables

Border color

The card border color can be customized using --card-border-color.

Note: this variable works only with outlined appearance.

Trim headline

The card headline can be trimmed to your preferable number of lines. The number of lines is controlled by the css variable --headline-line-clamp.

Trim subtitle

The card subtitle can be trimmed to your preferable number of lines. The number of lines is controlled by css variable --subtitle-line-clamp.

API Reference

Properties

PropertyTypeDefaultDescription
appearance'ghost' | 'outlined' | 'elevated'Sets the element's appearance.
clickableCardbooleanIndicates whether card should be a clickable <button> element.
downloadstringPrompts the user to save the linked URL. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
elevation0 | 2 | 4 | 8 | 12 | 16 | 24Sets the element's elevation.
headlinestringSets the element's headline.
hrefstringThe URL the hyperlink references. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
hreflangstringHints at the language of the referenced resource. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
pingstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
referrerpolicystringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
relstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
subtitlestringSets the element's subtitle.
target'_self' | '_blank' | '_parent' | '_top'See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
textstringSets the element's text.
typestringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
PropertyTypeDefaultDescription
appearance'ghost' | 'outlined' | 'elevated'Sets the element's appearance.
clickable-cardbooleanIndicates whether card should be a clickable <button> element.
downloadstringPrompts the user to save the linked URL. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
elevation0 | 2 | 4 | 8 | 12 | 16 | 24Sets the element's elevation.
headlinestringSets the element's headline.
hrefstringThe URL the hyperlink references. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
hreflangstringHints at the language of the referenced resource. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
pingstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
referrerpolicystringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
relstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
subtitlestringSets the element's subtitle.
target'_self' | '_blank' | '_parent' | '_top'See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
textstringSets the element's text.
typestringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.

Slots

NameDescription
bodyThe body slot is for the main content of the card. Displayed between the header and footer content.
footerThe footer slot is for content in the card footer.
graphicThe graphic slot overrides the icon slot.
iconThe preferred way to add an icon to the component.
mainAssign nodes to main slot to fully override a card's predefined flow and style with your own.
mediaThe media slot is mainly for images or video content above the card header.
metaThe meta slot is for action content in the card header.
NameDescription
bodyThe body slot is for the main content of the card. Displayed between the header and footer content.
footerThe footer slot is for content in the card footer.
graphicThe graphic slot overrides the icon slot.
iconThe preferred way to add an icon to the component.
mainAssign nodes to main slot to fully override a card's predefined flow and style with your own.
mediaThe media slot is mainly for images or video content above the card header.
metaThe meta slot is for action content in the card header.