Documentation

Card

A surface that groups a title, content and actions into one tidy block.

Weekly digest
Sent every Monday at 9:00

A roundup of the top threads, new members and unanswered questions from your community.

Usage

import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@vitnode/core/components/ui/card'
<Card>
  <CardHeader>
    <CardTitle>Weekly digest</CardTitle>
    <CardDescription>Sent every Monday at 9:00</CardDescription>
  </CardHeader>
  <CardContent>A roundup of the top threads.</CardContent>
  <CardFooter>
    <Button variant="outline">Preview email</Button>
  </CardFooter>
</Card>

CardFooter has a top border and a soft background, so it always reads as the "what now?" part. An img as the first or last child goes edge to edge with rounded corners.

Size

Default
24px spacing

1,204 members online right now.

Small
16px spacing

1,204 members online right now.

size="sm" drops the spacing from 24px to 16px and shrinks the title. Use it in dense grids and sidebars.

<Card size="sm">...</Card>

Header with border

Community rules
Last updated in March

Be kind, stay on topic and search before you post. Moderators may close duplicate threads.

Add border-b to CardHeader and it gets matching bottom padding.

<CardHeader className="border-b">...</CardHeader>
Pending approval

3 new members are waiting for a moderator to approve their accounts.

A bordered header plus the footer splits the card into three parts.

Border separation

Reports

2 posts were reported for spam in the last hour.

Drop the card padding and let the content draw the lines. CardAction keeps a header button on the end side.

<Card className="gap-0 p-0">
  <CardHeader className="items-center px-4 py-2">
    <CardTitle>Reports</CardTitle>
    <CardAction>
      <Button size="sm" variant="outline">
        Filter
      </Button>
    </CardAction>
  </CardHeader>
  <CardContent className="border-y px-4 py-3">...</CardContent>
  <CardFooter className="border-none px-4 py-3">...</CardFooter>
</Card>
New to plugins?

Build your first VitNode plugin in about ten minutes, coffee included.

A slim footer is a good home for a "read more" link.

<CardFooter className="py-2">
  <a className={cn(buttonVariants({ variant: 'link' }), 'px-0')} href="/guide">
    Read the guide
  </a>
</CardFooter>

Props

All parts take regular div props.

Card

Prop

Type