āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/adityakishore0/scrollx-ui/components/card ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
<ComponentPreview name="card-demo" description="A subscription card for email and topic selection." />
<Step>Copy and paste the following code into your project.</Step>
<p> <code>card.tsx</code> </p> <ComponentSource name="card" /><Step>Add util file</Step>
<p> <code>lib/utils.ts</code> </p>import { ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
</Steps>
</TabsContent>
</Tabs>
import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
<Card>
<CardHeader>
<CardTitle>Card Title</CardTitle>
<CardDescription>Card Description</CardDescription>
<CardAction>Card Action</CardAction>
</CardHeader>
<CardContent>
<p>Card Content</p>
</CardContent>
<CardFooter>
<p>Card Footer</p>
</CardFooter>
</Card>
<Card className="custom-card-style">
<CardHeader>
<CardTitle>Custom Card</CardTitle>
<CardDescription>This card has a custom style.</CardDescription>
<CardAction>Card Action</CardAction>
</CardHeader>
<CardContent>
<p>Additional content with custom styles.</p>
</CardContent>
<CardFooter>
<Button variant="link">Learn More</Button>
</CardFooter>
</Card>
CardAction component to place actions (buttons, links) in the CardHeader aligned to the top-right.data-slot attributes for consistent styling.The Card component is used to create a customizable container with content sections such as title, description, and footer.
<PropsTable rows={[ { prop: "className", type: "string", default: "ā", description: "Custom classes for styling.", }, { prop: "...props", type: "React.HTMLAttributes<HTMLDivElement>", default: "ā", description: "All standard div props.", }, { prop: "CardHeader", type: "React.ReactNode", default: "ā", description: "Header section.", }, { prop: "CardTitle", type: "React.ReactNode", default: "ā", description: "Title inside header.", }, { prop: "CardDescription", type: "React.ReactNode", default: "ā", description: "Description inside header.", }, { prop: "CardAction", type: "React.ReactNode", default: "ā", description: "Action (e.g., button) in header.", }, { prop: "CardContent", type: "React.ReactNode", default: "ā", description: "Main content area.", }, { prop: "CardFooter", type: "React.ReactNode", default: "ā", description: "Footer section.", }, ]} />
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā