Preview

Sign In

Enter your credentials to access your account

Remember me

Installation

<> import.ts
import { Card } from "@/components/ui/card"

Code

<> component.tsx
import { Card } from "@/components/ui/card"

<Card title="Card Title" description="Card description">
  <p>Card content goes here.</p>
</Card>

API Reference

Card

Displays a card with header, content, and footer.

<> import.ts
import { Card } from "@/components/ui/card"

Props

PropTypeDefaultDescription
title
stringTitle text for the card
description
stringDescription text for the card
children
React.ReactNodeContent to display inside the card
className
string""Additional CSS classes
dashed
booleanfalseWhether to use dashed border
shadow
booleantrueWhether to show shadow
padding
string"p-6"Padding classes for the card
rounded
string"rounded-lg"Rounded corner classes
titleClassName
string""Additional CSS classes for title
descriptionClassName
string""Additional CSS classes for description
contentClassName
string""Additional CSS classes for content

Examples

Example 1
<> example.tsx
// Basic card
<Card title="Card Title" description="Card description">
  <p>Card content goes here</p>
</Card>
Example 2
<> example.tsx
// Card with dashed border
<Card dashed={true} title="Dashed Card">
  <p>This card has a dashed border</p>
</Card>
Example 3
<> example.tsx
// Card without shadow
<Card shadow={false} title="No Shadow">
  <p>This card has no shadow</p>
</Card>
Example 4
<> example.tsx
// Card with custom padding
<Card padding="p-4" title="Custom Padding">
  <p>This card has custom padding</p>
</Card>