Skip to main content

Starwind UI v1.15 is now available! With new prose, sidebar, and more components

Card

Create project
Deploy your new project in one-click.

Installation

Usage

Form Submission

You can easily add a standard html form submission to your card. Here is a full example with the javascript submission code.

Tip

Open up your browser’s dev tools and view the console to see the form data.

Create project
Deploy your new project in one-click.

Size

Use the size="sm" prop to set the size of the card to small. The small size variant uses smaller spacing.

Small Card
This card uses the small size variant.

The card component supports a size prop that can be set to "sm" for a more compact appearance.

Image

Add an image before the card header to create a card with an image. Use the CardAction component to position a badge or other action in the header.

Event cover
Featured
Design systems meetup
A practical talk on component APIs, accessibility, and shipping faster.

API Reference

Card

The root component that serves as a container for card content.

PropTypeDefault
size"default" | "sm""default"
classstring-
<Card size="default">
<!-- Card content -->
</Card>

Additional Notes:

  • size: Controls the overall spacing and text size. Use "sm" for a more compact appearance.

CardHeader

A container for card header content, typically containing the title and description.

PropTypeDefault
classstring-
<CardHeader>
<CardTitle>Title</CardTitle>
<CardDescription>Description</CardDescription>
</CardHeader>

CardTitle

A component for rendering the card title with appropriate font styling.

PropTypeDefault
classstring-
<CardTitle>Create project</CardTitle>

CardDescription

A component for rendering the card description with muted colors and appropriate text styling.

PropTypeDefault
classstring-
<CardDescription>Deploy your new project in one-click.</CardDescription>

CardContent

A container for the main content of the card.

PropTypeDefault
classstring-
<CardContent>
<!-- Main card content -->
</CardContent>

CardFooter

A container for card footer content, typically containing action buttons.

PropTypeDefault
classstring-
<CardFooter>
<Button>Action</Button>
</CardFooter>

CardAction

A component for positioning actions (like badges or buttons) in the card header. Designed to be placed inside CardHeader.

PropTypeDefault
classstring-
<CardHeader>
<CardAction>
<Badge>Featured</Badge>
</CardAction>
<CardTitle>Title</CardTitle>
</CardHeader>

Changelog

v2.0.0

  • Added size prop to Card component ("default" | "sm")
  • Added CardAction component for positioning actions in card headers
  • Added support for images within cards with automatic rounded corners
  • Update styling to more closely match the shadcn/ui card component

v1.3.0

  • style updates

v1.2.0

  • Add a data-slot attribute to all components to enable global styling updates

v1.1.0

  • tailwind-variants now implemented. This uses tailwind-merge under the hood to merge Tailwind classes without style conflicts, allowing you to override any existing classes using the “class” prop.