Card
vig-card [vigCardHeader] [vigCardFooter]
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
Header and footer
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
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.
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
Medium
Large
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"]
| Part | Element | data-state |
|---|---|---|
header | [vigCardHeader] . | — |
heading | h2 – h6 of heading . | — |
body | — | |
footer | [vigCardFooter] row. | — |
action | interactive card clickable. | — |
Accessibility
- The card itself has no role; its
headingrenders as a realh2–h6(headingLevel). Pick the level that fits the page's outline. In a customvigCardHeader, provide the heading element yourself. - An
interactivecard uses the stretched-button pattern: its title is a real<button>(Enter and Space activate it) whose overlay makes the whole card clickable. Without aheading, 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-ringon the card when its button has keyboard focus; the hover lift is disabled withprefers-reduced-motion.
API
Card
vig-cardBordered 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.
<vig-card heading="Season" [elevated]="true">
Body copy
<div vigCardFooter><vig-button label="Edit" /></div>
</vig-card>| Name | Type | Default | Description |
|---|---|---|---|
elevated | boolean | false | Raises the surface with the small elevation token. |
header | string | undefined | undefined | Deprecated: Use `heading`; still honored when `heading` is unset. — |
heading | string | undefined | undefined | Title text; use a |
headingLevel | CardHeadingLevel | 3 | Heading level ( |
interactive | boolean | false | Makes the whole card clickable through one real button that emits |
padding | CardPadding | 'md' | Inner spacing of header, body and footer. |
| Name | Payload | Description |
|---|---|---|
activated | Event | Click, Enter or Space on an interactive card's button. |
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). |