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
- Change
CardHeader to py-4 (matching px-5 py-4 convention throughout the app).
- Remove hardcoded
items-center from CardFooter; default to flex gap-3 only.
- Wrap all six Card sub-components in
forwardRef following the same pattern as Button.tsx.
Acceptance Criteria
Note for Contributors: Write a clear PR description. Show the before/after spacing difference in CardHeader and confirm ref forwarding with a TypeScript example.
Problem
The
Cardcomponent family has three issues that make it inconsistent and harder to compose.1.
CardHeaderusespt-5 pb-4— mismatches panel headers throughout the appEvery custom panel header uses
py-4, butCardHeaderusespt-5 pb-4, creating a spacing discrepancy when switching from custom headers toCardHeader.2.
CardFooterhardcodesflex items-center gap-3— no vertical layout supportConsumer panels needing a stacked footer (description above action buttons) cannot use
CardFooterwithout conflicting flex utilities.3. No
forwardRefon any Card sub-componentCard,CardHeader,CardContent,CardFooter,CardTitle, andCardDescriptionall acceptReact.HTMLAttributesbut none wrap withforwardRef. Consumers using Framer Motion, Radix tooltip, or intersection observers cannot attach refs.Solution
CardHeadertopy-4(matchingpx-5 py-4convention throughout the app).items-centerfromCardFooter; default toflex gap-3only.forwardReffollowing the same pattern asButton.tsx.Acceptance Criteria
CardHeaderusespy-4CardFooterno longer hardcodesitems-centerforwardRef<Card>compiles without TypeScript errorsnpm run buildandtsc --noEmitpass