Skip to content

Card

<tpg-card></tpg-card>

Usage

The Ultimate Card is the best component you’ve ever seen and you’ll probably ever see.

It looks complicated because it is complicated, but so it’s every masterpiece at the pinnacle of its field.

However if you can’t figure out how to use it you should be ashamed of being called a designer (or a developer).

Bask in the glory of The Ultimare Card.

— Davide

Guidelines

The Ultimate Cards scale in width to the parent container, and in height by their content.

  • min-width: 344px
  • height: fit-content
Do´s

A card function is to show an at-glance overview of essential, aggregated information.

Dont´s

Avoid filling the card with non-necessary functions, states, and secondary information. It’s best not to used a visually unalligned grid that can impair readability.

Examples

Card - default (with background)

Added some text to the primary-label, secondary-label, header and subtitle attributes.

Unselected

Selected

Card state - no-background

Added some text to the primary-label, secondary-label, header and subtitle attributes.

Unselected

Selected

Card state - read-only

Added some text to the primary-label, secondary-label, header and subtitle attributes.

Unselected

Selected

Current Item Indicator

You can toggle the Current Item Indicator using the current-indicator flag.

Slots

Filling all slots with some content. Added some text to the primary-label, secondary-label, header and subtitle props.

With slot="header-leading-buttons"

With slot="header-trailing-buttons"

With slot="header-stuff"

With slot="header-stuff", slot="header-trailing-buttons", and slot="header-leading-buttons"

With slot="card-row-1"

With slot="card-row-1" & slot="card-row-2"

All slots used

Header Stuff

stuff

stuff

Tables

Properties

Attribute Property Description Type Default Value
selected selected Indicates if the card is in a selected state boolean false
no-background noBackground Removes the background color from the card when true boolean false
current-indicator currentIndicator Toggles visibility of Current Item Indicator boolean false
read-only readOnly Makes the card non-interactive when true boolean false
primary-label primaryLabel Main text content displayed in the card header string ''
secondary-label secondaryLabel Secondary text content displayed below the primary text string ''
heading heading Text displayed above the primary text string ''
subtitle subtitle Text displayed below the primary text string ''

Events

Event name Reactjs attribute Description
tpg-click ontpg-click event fired when clicking on the card

Functions

Name Description Arguments
No functions found.

Slots

Name Description
header-leading-buttons html slot for adding content to the header leading buttons slot
header-trailing-buttons html slot for adding content to the header trailing buttons slot
header-stuff html slot for adding content to the header stuff slot
card-row-1 slot for adding content to the card-row-1 slot
card-row-2 slot for adding content to the card-row-2 slot

CSS Parts

Attribute Description
header-stuff part for adding styling to the header-stuff slot
card-row-1 part for adding styling to the card-row-1 slot
card-row-2 part for adding styling to the card-row-2 slot

Sandbox