Card

A bordered surface that groups related content and actions, such as a summary, a settings section or an item in a grid. It has an optional header and footer and can be raised or made clickable as a whole.

  • vig-card
  • [vigCardHeader]
  • [vigCardFooter]
Import
import { Card, CardHeader, CardFooter } from '@vigdx/ui/card';

Basic

heading renders a title above the projected body. Without it the card is a plain bordered surface.

Opening hours

Monday to Friday, 9:00 to 18:00. Closed on public holidays.
A card without a header is a plain bordered surface for any content.

Mark an element vigCardHeader for a richer header row (bring your own heading) and one vigCardFooter for an action row, separated by a rule and aligned to the end.

Ticket prices

Draft
Adult €42, child €36, under-fours free. Prices apply from 1 April.

Elevated

elevated adds the small shadow token to lift a card off the page, e.g. for dashboard tiles. headingLevel picks the h2 – h6 element of the header title (3 by default) to fit the page outline.

Revenue

€48,210

+12% vs. last month

Orders

1,284

Same as last month

Refunds

23

+4 vs. last month

Interactive

interactive makes the whole card clickable through its title, a real button whose overlay covers the card: click, Enter and Space emit activated . Footer actions such as Compare stay above the overlay and work on their own. For picking one of several cards, use radios ( vig-radio-group ) instead.

Free for up to 3 users

€8 per user and month

€16 per user and month

Opened: — · Compared: —

Padding

padding sets the inner spacing of header, body and footer: sm , md (default), lg or none for edge-to-edge media. The corner radius follows --radius-card .

Small

Compact lists and sidebars.

Medium

The default.

Large

Roomy feature panels.

padding="none" lets media run edge to edge; pad the text yourself.

Styling hooks

Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="card"][data-part="header"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.

Scope: [data-scope="card"]

Card styling hooks
Part Element data-state
header The header row: heading and [vigCardHeader] . —
heading The h2 – h6 of heading . —
body The body. —
footer The [vigCardFooter] row. —
action The button that makes an interactive card clickable. —

Accessibility

  • The card itself has no role; its heading renders as a real h2–h6 (headingLevel). Pick the level that fits the page's outline. In a custom vigCardHeader, provide the heading element yourself.
  • An interactive card uses the stretched-button pattern: its title is a real <button> (Enter and Space activate it) whose overlay makes the whole card clickable. Without a heading, a covering button is named by the card's text, so keep that short.
  • Links, buttons and form fields inside an interactive card sit above the overlay and work on their own, so independent footer actions are fine; they are not nested in the card's button.
  • Interactive cards draw the --shadow-focus-ring on the card when its button has keyboard focus; the hover lift is disabled with prefers-reduced-motion.

API

Card

vig-card component

Bordered surface grouping related content. A heading string (or a [vigCardHeader] element) sits above the projected body and a [vigCardFooter] element below it. The heading renders as a real h2–h6 (headingLevel).

interactive makes the whole card clickable through one real <button> (the stretched-control pattern): with a heading the title itself is the button, otherwise an unlabelled-looking button covers the card, named by the card's text. Its ::after overlay stretches the pointer target across the card while links, buttons and form controls inside the card stay on top and keep working on their own. Click, Enter or Space on the card's button emit activated; focus is drawn on the card.

Example :
<vig-card heading="Season" [elevated]="true">
  Body copy
  <div vigCardFooter><vig-button label="Edit" /></div>
</vig-card>
Card props
Name Type Default Description
elevatedbooleanfalse

Raises the surface with the small elevation token.

headerstring | undefinedundefined

Deprecated: Use `heading`; still honored when `heading` is unset.

—
headingstring | undefinedundefined

Title text; use a [vigCardHeader] element for richer headers.

headingLevelCardHeadingLevel3

Heading level (h2–h6) of the heading title.

interactivebooleanfalse

Makes the whole card clickable through one real button that emits activated.

paddingCardPadding'md'

Inner spacing of header, body and footer. none for edge-to-edge media.

Templates and directives

Templates and directives
Selector Export Description
[vigCardHeader]CardHeader

Marks projected content as the card's header row (title, actions…).

[vigCardFooter]CardFooter

Marks projected content as the card's footer (action row).

Are you sure?