Skip to main content

Starwind UI v3.0 beta is now available! Read the migration guide

Create project
Deploy your new project in one-click.

Runtime example adjustment

required, name, and the selected value now belong to the Runtime-backed Select root. The trigger keeps the id referenced by the label.

Installation

Framework Availability

Astro Available React Available

Card is available for Astro and React.

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.

Runtime example adjustment

The Runtime-backed Select participates in native form submission through its name prop. Reading FormData now captures both the text input and Select value without querying Select’s internal markup.

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

Styled Component API

These props are added or materially changed by the installed Astro styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Follow the Primitive and Runtime links for lower-level behavior props.

Card

Inherits div attributes.

Contains the following additional props:

Prop Type Default Toggle details
size "default" | "sm" "default"
Description
Selects the component's visual size.
Classification
Styled variant

Changelog

v2.1.0

  • Added contract-generated Astro and React implementations while preserving the component’s existing public API and styling.

v2.0.2

  • Refactor tailwind variants functions into separate variants.ts file

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.