Skip to content

Card

Vue component for content grouping and navigation cards. For guidelines, best practices, and design rationale, see the Design System — Card reference.


Demo

Standard (raised)

Placeholder
Guide

Design Tokens

Learn how design tokens power the entire Grundtone system.

Navigation card

Bordered

Bordered Card

A card with a subtle border instead of elevation.

Flat

Flat Card

No background, no border — just structure and spacing.

Horizontal

Placeholder
Feature

Horizontal Layout

Image on the left, content on the right.

With footer

Placeholder

Card with Footer

Footer content is pushed to the bottom via flex.

With buttons

Course image
Course

Introduction to Design Tokens

Learn the fundamentals of design tokens and how to apply them.

Grid (equal height)

Grid

Short

Brief content.

Grid

Medium

A bit more content to demonstrate that cards stretch to equal height in a grid layout.

Grid

With Footer

Footer stays at bottom.

Article card (with meta + tag)

Article image

Design Tokens in Practice

Design6 min read

How to leverage design tokens across platforms.

External nav card


Installation

bash
pnpm add @grundtone/vue

Usage

Basic

vue
<template>
  <GTCard title="Design Tokens">
    <p>Learn how design tokens power the system.</p>
  </GTCard>
</template>

With image

vue
<template>
  <GTCard
    title="Getting Started"
    subheading="Guide"
    image="/hero.jpg"
    image-alt="Hero image"
  >
    <p>Set up Grundtone in under 5 minutes.</p>
  </GTCard>
</template>
vue
<template>
  <GTCard nav href="/docs" title="Documentation" subheading="Docs">
    <p>Browse the full documentation.</p>
  </GTCard>
</template>

Horizontal

vue
<template>
  <GTCard horizontal title="Feature" image="/side.jpg" image-alt="Side image">
    <p>Image on the left, content on the right.</p>
  </GTCard>
</template>

Bordered

vue
<template>
  <GTCard variant="bordered" title="Bordered">
    <p>Subtle border instead of elevation.</p>
  </GTCard>
</template>
vue
<template>
  <GTCard title="Card with Footer">
    <p>Footer content is pushed to the bottom.</p>
    <template #footer>
      <a href="#">Read more</a>
    </template>
  </GTCard>
</template>

Sizing

A card has no intrinsic width — it fills its container. Control width through the layout: a grid, a flex parent, or a max-width wrapper.

vue
<!-- Grid controls the width -->
<template>
  <div class="grid grid-cols-3 gap-md">
    <GTCard title="One">...</GTCard>
    <GTCard title="Two">...</GTCard>
    <GTCard title="Three">...</GTCard>
  </div>
</template>

<!-- Standalone — constrain with a wrapper -->
<template>
  <div class="max-w-sm">
    <GTCard title="Constrained">...</GTCard>
  </div>
</template>

Props

PropTypeDefaultDescription
titlestringrequiredCard title
variant'raised' | 'bordered' | 'flat''raised'Visual style variant
navbooleanfalseRender as navigation card (<a>)
hrefstringURL for navigation cards
externalbooleanfalseOpens in new tab (nav cards)
horizontalbooleanfalseHorizontal layout
subheadingstringSubheading text above the title
imagestringImage URL
imageAltstringImage alt text
imageAspectstringImage aspect ratio CSS value
ariaLabelstringAccessible label

Slots

SlotDescription
defaultBody content (text, rich content)
mediaCustom media content (overrides image prop)
footerFooter with links/buttons, pushed to bottom via flex

Accessibility

  • Standard cards render as <article> elements
  • Navigation cards render as <a> with href
  • External links include target="_blank" and rel="noopener noreferrer"
  • Focus-visible ring on nav cards (3px solid, 2px offset)
  • prefers-reduced-motion disables hover transform
  • Icons in nav cards are decorative (aria-hidden="true")

CSS Classes

ClassElement
.gt-cardRoot container
.gt-card--raisedRaised variant (default)
.gt-card--borderedBordered variant
.gt-card--flatFlat variant
.gt-card--navNavigation card
.gt-card--horizontalHorizontal layout
.gt-card__mediaImage/media wrapper
.gt-card__contentContent container
.gt-card__subheadingSubheading text
.gt-card__titleTitle
.gt-card__bodyBody content
.gt-card__footerFooter
.gt-card__arrowNavigation arrow icon

Design system

For guidelines, best practices, and references, see the Design System — Card documentation.