Skip to content

wc-card

apps/docs/src/content/docs/component-library/wc-card Click to copy
Copied! apps/docs/src/content/docs/component-library/wc-card
<wc-card>

Content container with image, heading, body, footer, and action slots.

A flexible card component for displaying grouped content.

Default, featured, and compact card styles.

Variants

Default Card

Standard card for general content display.

Featured Card

Highlighted card for important content.

Compact Card

Condensed layout for dense UIs.

Flat, raised, and floating shadow depths.

Elevations

Flat

No shadow — blends into the surface.

Raised

Subtle shadow for visual separation.

Floating

Prominent shadow for emphasis.

All available slots: image, heading, body, footer, and actions.

Full Slot Usage

Image Slot
Card Title

This is the default body slot with descriptive content for the card.

Published Feb 2026
ActionCancel

Card with href becomes clickable.

Interactive Card

Clickable Card

This card has an href attribute — click anywhere to navigate.

Properties

3
AttributeTypeDefaultDescription
variant'default' | 'featured' | 'compact''default'Visual style variant of the card.
elevation'flat' | 'raised' | 'floating''flat'Elevation (shadow depth) of the card.
hrefstring | undefinedOptional URL. When set, the card becomes interactive (clickable) and navigates to this URL on click.

Events

1
NameTypeDescription
wc-card-clickCustomEventDispatched when an interactive card (with href) is clicked.

Slots

5
NameDescription
imageOptional image or media content at the top of the card.
headingThe card heading/title content.
(default)Default slot for the card body content.
footerOptional footer content below the body.
actionsOptional action buttons, rendered with a top border separator.

CSS Custom Properties

6
PropertyDescription
--wc-card-bgCard background color.
--wc-card-colorCard text color.
--wc-card-border-colorCard border color.
--wc-card-border-radiusCard border radius.
--wc-card-paddingInternal padding for card sections.
--wc-card-gapGap between card sections.

CSS Parts

6
PartDescription
cardThe outer card container element.
imageThe image slot container.
headingThe heading slot container.
bodyThe body slot container.
footerThe footer slot container.
actionsThe actions slot container.