Skip to content

@vibe-labs/design-components-cards

Card component tokens, styles, and TypeScript types for the Vibe Design System.

Usage

css
@import "@vibe-labs/design-components-cards";
ts
import { CardSizes, CardVariants } from "@vibe-labs/design-components-cards/types";
import type { CardSize, CardVariant, CardStyleProps } from "@vibe-labs/design-components-cards/types";

Contents

Tokens (card.css)

CSS custom properties defined in @layer vibe.tokens:

Padding Scale

TokenValue
--card-padding-sm--space-3
--card-padding-md--space-4
--card-padding-lg--space-6

Appearance

TokenDefaultDescription
--card-radius--radius-lgBorder radius
--card-bg--surface-baseBackground
--card-border-color--border-subtleBorder color
--card-border-width--border-width-1Border width
--card-shadow--shadow-smElevated variant shadow
--card-shadow-hover--shadow-mdElevated hover shadow
--card-header-border--border-subtleHeader bottom border
--card-footer-border--border-subtleFooter top border
--card-footer-bg--surface-subtleFooter background
--card-hover-bg--surface-elevatedInteractive hover background

Generated Styles (card.g.css)

Component classes generated into @layer vibe.components.

Variants

VariantDescription
defaultSurface background with subtle border
elevatedNo border, box shadow
outlinedTransparent bg, default border
ghostFully transparent
gradientGradient card background
gradient-subtleSubtle gradient background
gradient-elevatedElevated gradient background

Sizes

sm · md · lg — controls padding on header, body, and footer sections (default: md)

Sections

  • card-header — flex row with bottom border
  • card-body — flex-grow content area
  • card-footer — flex row with top border and subtle background
  • card-media — overflow-hidden container for images/video (full-width, auto-height, object-fit cover)

Interactive

When flagged as interactive: pointer cursor, transitions on bg/shadow/border, hover background change, elevated shadow lift on hover, focus-visible ring.

Modifiers

  • horizontal — row layout, media capped at 40% width
  • seamless — removes header/footer internal borders and footer background
  • flush — removes all section padding

TypeScript Types (types/)

ts
CardSizes    // ["sm", "md", "lg"]
CardVariants // ["default", "elevated", "outlined", "ghost",
             //  "gradient", "gradient-subtle", "gradient-elevated"]

type CardSize
type CardVariant

interface CardStyleProps {
  variant?: CardVariant
  size?: CardSize
  interactive?: boolean
  horizontal?: boolean
  seamless?: boolean
  flush?: boolean
}

interface CardHeaderStyleProps {}
interface CardBodyStyleProps {}
interface CardFooterStyleProps {}
interface CardMediaStyleProps {}

Dist Structure

FileDescription
index.cssBarrel — imports tokens + generated styles
card.cssToken definitions
card.g.cssGenerated component styles
index.js / index.d.tsTypeScript types + runtime constants

Dependencies

Requires tokens from @vibe-labs/design (surfaces, borders, spacing, elevation, gradients, transitions).

Build

bash
npm run build