Card
A flexible container component for grouping related content.
Import
import { Card } from 'poodle'Usage
Basic Card
Card Title
This is a basic card component with some content inside.
<Card>
<h3>Card Title</h3>
<p>This is a basic card component with some content inside.</p>
</Card>Card with Header and Footer
Card Header
Card body content goes here.
<Card>
<Card.Header>
<h3>Card Header</h3>
</Card.Header>
<Card.Body>
<p>Card body content goes here.</p>
</Card.Body>
<Card.Footer>
<Button>Action</Button>
</Card.Footer>
</Card>Hover Effect
Hover Me
This card has a hover effect.
<Card hoverable>
<h3>Hover Me</h3>
<p>This card has a hover effect.</p>
</Card>Card Grid
🎨
Design
Beautiful UI components
⚡
Performance
Lightning fast
🔧
Customizable
Easy to customize
<div className="grid grid-cols-3 gap-4">
<Card>
<h3>Design</h3>
<p>Beautiful UI components</p>
</Card>
<Card>
<h3>Performance</h3>
<p>Lightning fast</p>
</Card>
<Card>
<h3>Customizable</h3>
<p>Easy to customize</p>
</Card>
</div>Product Card
New
Product Name
A brief description of the product.
$99
<Card className="max-w-sm">
<img src="/product.jpg" alt="Product" />
<Badge>New</Badge>
<h3>Product Name</h3>
<p>A brief description of the product.</p>
<div className="flex justify-between items-center">
<span className="text-2xl font-bold">$99</span>
<Button>Buy Now</Button>
</div>
</Card>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | undefined | Card content |
| className | string | undefined | Additional CSS classes |
| hoverable | boolean | false | Enable hover effect |
| padding | 'none' | 'sm' | 'md' | 'lg' | 'md' | Internal padding |
| shadow | 'none' | 'sm' | 'md' | 'lg' | 'sm' | Shadow depth |
Examples
Stats Card
function StatsCard() {
return (
<Card>
<h4 className="text-gray-500 text-sm">Total Users</h4>
<p className="text-3xl font-bold mt-2">12,345</p>
<div className="text-green-600 text-sm mt-2">
↑ 12% from last month
</div>
</Card>
)
}Feature Card
function FeatureCard() {
return (
<Card hoverable className="text-center">
<div className="text-4xl mb-4">🚀</div>
<h3 className="text-xl font-bold mb-2">Fast Performance</h3>
<p className="text-gray-600">
Optimized for speed and efficiency
</p>
</Card>
)
}User Profile Card
function ProfileCard() {
return (
<Card>
<div className="flex items-center gap-4">
<img
src="/avatar.jpg"
alt="User"
className="w-16 h-16 rounded-full"
/>
<div>
<h3 className="font-bold">John Doe</h3>
<p className="text-gray-600">Software Engineer</p>
</div>
</div>
<div className="mt-4 flex gap-2">
<Button variant="outline" size="sm">
Message
</Button>
<Button size="sm">Follow</Button>
</div>
</Card>
)
}Best Practices
Do ✅
- Use cards to group related content
- Keep card content concise
- Use consistent padding
- Consider hover effects for interactive cards
Don’t ❌
- Don’t nest cards too deeply
- Don’t overuse shadows
- Don’t make cards too wide
- Don’t mix too many card styles