Skip to content

fix(Card): CardHeader padding mismatch, CardFooter hardcodes flex items-center, no forwardRef on sub-components #103

Description

@k-deejah

Problem

The Card component family has three issues that make it inconsistent and harder to compose.

1. CardHeader uses pt-5 pb-4 — mismatches panel headers throughout the app

Every custom panel header uses py-4, but CardHeader uses pt-5 pb-4, creating a spacing discrepancy when switching from custom headers to CardHeader.

2. CardFooter hardcodes flex items-center gap-3 — no vertical layout support

Consumer panels needing a stacked footer (description above action buttons) cannot use CardFooter without conflicting flex utilities.

3. No forwardRef on any Card sub-component

Card, CardHeader, CardContent, CardFooter, CardTitle, and CardDescription all accept React.HTMLAttributes but none wrap with forwardRef. Consumers using Framer Motion, Radix tooltip, or intersection observers cannot attach refs.

Solution

  1. Change CardHeader to py-4 (matching px-5 py-4 convention throughout the app).
  2. Remove hardcoded items-center from CardFooter; default to flex gap-3 only.
  3. Wrap all six Card sub-components in forwardRef following the same pattern as Button.tsx.

Acceptance Criteria

  • CardHeader uses py-4
  • CardFooter no longer hardcodes items-center
  • All six Card sub-components use forwardRef
  • Attaching a ref to <Card> compiles without TypeScript errors
  • npm run build and tsc --noEmit pass

Note for Contributors: Write a clear PR description. Show the before/after spacing difference in CardHeader and confirm ref forwarding with a TypeScript example.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions