Card

Card surface for composing login flows, sign-up forms, pricing tiles, payment methods, empty states, and stat showcases.

import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@plexui/vue/components/Card";

Examples

Anatomy

<Card>
  <CardHeader>
    <CardTitle />
    <CardDescription />
    <CardAction />  <!-- optional top-right slot -->
  </CardHeader>
  <CardContent />
  <CardFooter />
</Card>

API

Card

PropTypeDefaultDescription
variant"outline" | "solid" | "ghost""outline"Visual variant
size"sm" | "md" | "lg""md"Padding scale
interactivebooleanfalseAdds hover and focus affordances. Automatic when href is set.
hrefstringRenders the Card as a link via the linkComponent of PlexUIProvider. A link component that takes to, such as RouterLink, gets it as to.
externalbooleanauto-detectedForces target="_blank" and rel="noopener noreferrer" when href is set.
asComponent | "a"Overrides the link component.
classstringApplied to the root element

All other attributes and listeners fall through to the root <div> or link.

Compound parts

PartElementPurpose
CardHeader<div>Title + description + optional action
CardTitle<h3>Card heading
CardDescription<p>Subtitle / explanation
CardContent<div>Primary body region
CardFooter<div>Trailing actions row
CardAction<div>Absolute top-right slot inside CardHeader

Styling

Card reads these component tokens. Override them at any scope to restyle it:

  • --card-background: background (default var(--color-surface))
  • --card-background-hover: background hover (default var(--color-surface-secondary))
  • --card-border-color: border color (default var(--color-border))
  • --card-border-color-hover: border color hover (default var(--color-border-primary-outline-hover))
  • --card-description-color: description color (default var(--color-text-tertiary))
  • --card-description-font-size: description font size (default var(--font-text-sm-size))
  • --card-font-size: font size (default var(--font-text-sm-size))
  • --card-radius: radius (default var(--radius-xl))
  • --card-text-color: text color (default var(--color-text))
  • --card-title-color: title color (default var(--color-text))
  • --card-title-font-size: title font size (default var(--font-heading-xs-size))
  • --card-title-font-weight: title font weight (default var(--font-weight-semibold))