Card

Stable
This component has limited functionality on the server side. In Next.js, add "use client" at the top to make it work.

A practical container component for grouping related content with different styling options.

Import

TypeScript React
import { Card, CardHeader, CardTitle, CardDescription, CardBody, CardFooter } from "laxod";

Basic Usage

The simplest card with just content inside.

Basic Card

Card Title

This is a basic card with a title and description.

Card content goes here. You can put any content inside the card body.

Variants

Cards come in different visual styles to fit your needs.

Card Variants

Default

Standard card

Fancy

Card with moving border glow effect

Outlined

Card with border

Flat

Minimal card with no border

Padding

Control the amount of internal spacing with the padding prop.

Card Padding

No padding

Small padding

Medium padding (default)

Large padding

Interactive Cards

Cards can be made clickable by passing an onClick handler.
Setting the interactive prop adds the pointer cursor.

Interactive Card

Click Me!

This card is interactive and responds to clicks.

Times clicked: 0

Card with Footer

Use CardFooter to add action buttons or additional information.

Card with Actions

Complete Your Profile

Add more information to enhance your account.

Your profile is 60% complete. Add a profile picture and bio to finish.

Props

PropTypeDefaultDescription
childrenReactNode-Content to display in the card
variant"default" | "fancy" | "outlined" | "flat""default"Visual style of the card
padding"none" | "sm" | "md" | "lg""md"Internal spacing of the card
interactivebooleanfalseEnable hover effects and cursor pointer
onClick(e: MouseEvent) => void-Click handler (automatically makes card interactive)
classNamestring""Additional CSS classes to apply

Subcomponents

Card comes with several subcomponents for structured layouts.

ComponentDescription
CardHeaderContainer for card title and description
CardTitleMain heading for the card
CardDescriptionSubtitle or supporting text
CardBodyMain content area of the card
CardFooterFooter section for actions or metadata